Skip to content

Commit

Permalink
Push Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
rootmos committed Oct 27, 2024
1 parent 9690686 commit 02b81e5
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Run tests
name: Build, test and push image
on:
push:
workflow_dispatch:

jobs:
tests:
build-test-push:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
Expand Down Expand Up @@ -33,3 +33,20 @@ jobs:
- name: Run tests
run: |
docker run --rm $(<iid) test
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Tag and push image
run: |
docker tag $(<iid) rootmos/silly-k:$GITHUB_SHA
docker push rootmos/silly-k:$GITHUB_SHA
- name: Mark as latest image
if: github.ref_name == 'master'
run: |
docker tag $(<iid) rootmos/silly-k:latest
docker push rootmos/silly-k:latest

0 comments on commit 02b81e5

Please sign in to comment.