Skip to content

Commit

Permalink
Merge pull request #20 from NBISweden/chore/push-to-gcr
Browse files Browse the repository at this point in the history
chore: add github action to build and push image
  • Loading branch information
nanjiangshu authored Aug 2, 2023
2 parents b6b8f81 + c99dc35 commit 3ca0582
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/tag_and_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and push Docker image
on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image
uses: docker/build-push-action@v4
with:
context:
file: ./Dockerfile
push: true
tags: |
ghcr.io/shinynbis:latest
ghcr.io/shinynbis:${{ needs.tag.outputs.tag }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
org.opencontainers.image.revision=${{ github.sha }}

0 comments on commit 3ca0582

Please sign in to comment.