Skip to content

Merge pull request #69 from Spacelocust/fix/swagger #5

Merge pull request #69 from Spacelocust/fix/swagger

Merge pull request #69 from Spacelocust/fix/swagger #5

Workflow file for this run

name: Publish API
on:
workflow_run:
workflows: [Linting API, Testing API]
types: [completed]
branches: ["main"]
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-push-api:
name: Push Docker image API
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: docker/prod/golang/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: ${{ github.event_name != 'pull_request' }}
tags: spacelocust/fd-api:latest
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}