-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use v4 of actions/download-artifact action
- Loading branch information
Showing
1 changed file
with
50 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ name: CI/CD | |
|
||
on: | ||
push: | ||
branches: [ "master", "develop" ] | ||
tags: [ "v*.*.*" ] | ||
branches: ["master", "develop"] | ||
tags: ["v*.*.*"] | ||
pull_request: | ||
branches: [ "master" ] | ||
branches: ["master"] | ||
|
||
permissions: | ||
contents: write | ||
|
@@ -16,65 +16,65 @@ jobs: | |
runs-on: ubuntu-latest | ||
env: | ||
GO111MODULE: on | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.20' | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.20" | ||
|
||
- name: Install dependencies | ||
run: | | ||
go install github.com/swaggo/swag/cmd/[email protected] | ||
go get -d | ||
- name: Install dependencies | ||
run: | | ||
go install github.com/swaggo/swag/cmd/[email protected] | ||
go get -d | ||
- name: Build | ||
shell: pwsh | ||
run: ./build.ps1 | ||
- name: Build | ||
shell: pwsh | ||
run: ./build.ps1 | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: artifact | ||
path: ./bin/* | ||
- uses: actions/[email protected] | ||
with: | ||
name: artifact | ||
path: ./bin/* | ||
|
||
release: | ||
name: Release | ||
needs: build | ||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/')}} | ||
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/')}} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: output | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: artifact | ||
path: output | ||
- name: Create a release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
output/**/* | ||
generate_release_notes: true | ||
name: "${{ github.ref_name }}" | ||
|
||
- name: Create a release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
output/**/* | ||
generate_release_notes: true | ||
name: '${{ github.ref_name }}' | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Log in to the Container registry | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: | | ||
loupeznik/better-wapi:${{ github.ref_name }} | ||
loupeznik/better-wapi:latest | ||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: | | ||
loupeznik/better-wapi:${{ github.ref_name }} | ||
loupeznik/better-wapi:latest |