Bump alpine from 3.20.1 to 3.20.2 (#9) #28
This file contains 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
name: Docker Image CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: benjlevesque/[email protected] | |
id: short-sha | |
with: | |
length: 6 | |
- run: echo $SHA | |
env: | |
SHA: ${{ steps.short-sha.outputs.sha }} | |
- run: echo $SHA | |
env: | |
SHA: ${{ env.SHA }} | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag my-image-name:${{ steps.short-sha.outputs.sha }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push with commit number | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
tags: leto1210/docker-dnsmasq:${{ steps.short-sha.outputs.sha }} | |
- name: Build and push with latest tag | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
tags: leto1210/docker-dnsmasq:latest |