Skip to content

Commit

Permalink
GitHub Actions: add docker image builder
Browse files Browse the repository at this point in the history
  • Loading branch information
navigaid committed Sep 4, 2022
1 parent 01f031a commit b578c42
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Docker image

on:
push:

jobs:
docker-image:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- run: docker build -f .devcontainer/Dockerfile -t btwiuse/arch:${{ github.sha }} .
name: docker build

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# - run: docker push btwiuse/arch:${{ github.sha }}
# name: docker push

# - run: |
# docker tag btwiuse/arch:${{ github.sha }} btwiuse/arch
# docker push btwiuse/arch
# if: github.ref == 'refs/heads/main'
# name: docker push latest

- run: |
docker tag btwiuse/arch:${{ github.sha }} btwiuse/arch:${{ github.ref_name }}
docker push btwiuse/arch:${{ github.ref_name }}
name: docker push branch

0 comments on commit b578c42

Please sign in to comment.