Last active
May 22, 2025 02:48
-
-
Save initcron/2e2e71437ce0523c74882fd65084b510 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker_bnp: | |
runs-on: ubuntu-latest | |
needs: package | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build and test Docker image | |
run: | | |
COMMIT_HASH=$(echo ${{ github.sha }} | cut -c1-7) | |
docker build -t docker.io/${{ vars.DOCKERHUB_USERNAME }}/sysfoo:$COMMIT_HASH -f Dockerfile . | |
- name: Log in to DockerHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: docker.io | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push Docker image to DockerHub | |
run: | | |
COMMIT_HASH=$(echo ${{ github.sha }} | cut -c1-7) | |
docker tag docker.io/${{ vars.DOCKERHUB_USERNAME }}/sysfoo:$COMMIT_HASH docker.io/${{ vars.DOCKERHUB_USERNAME }}/sysfoo:latest | |
docker push docker.io/${{ vars.DOCKERHUB_USERNAME }}/sysfoo:$COMMIT_HASH | |
docker push docker.io/${{ vars.DOCKERHUB_USERNAME }}/sysfoo:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment