Skip to content

Commit

Permalink
add image push
Browse files Browse the repository at this point in the history
  • Loading branch information
azuki774 committed Aug 28, 2024
1 parent c4af788 commit 0a66774
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Publish

on:
push:
tags:
- v*

jobs:
build_and_push:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v4

- name: Set meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/azuki774/go-authenticator
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern=latest
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_ACCESS_TOKEN }}

- name: Docker Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64 #,linux/arm64
file: ./build/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 0a66774

Please sign in to comment.