Skip to content

Merge pull request #13 from Loupeznik/dependabot/go_modules/golang.or… #42

Merge pull request #13 from Loupeznik/dependabot/go_modules/golang.or…

Merge pull request #13 from Loupeznik/dependabot/go_modules/golang.or… #42

Workflow file for this run

name: CI/CD
on:
push:
branches: ["master", "develop"]
tags: ["v*.*.*"]
pull_request:
branches: ["master"]
permissions:
contents: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v4
- 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/swag@v1.8.0
go get -d
- name: Build
shell: pwsh
run: ./build.ps1
- uses: actions/upload-artifact@v4
with:
name: artifact
path: ./bin/*
release:
name: Release
needs: build
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/')}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
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: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4.0.0
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
loupeznik/better-wapi:${{ github.ref_name }}
loupeznik/better-wapi:latest