dev #252
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: dev | |
on: | |
push: | |
branches: | |
- 'master' | |
workflow_dispatch: | |
# vergoh/vnstat triggers builds on change and once per month | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check spelling | |
uses: crate-ci/typos@master | |
- name: Run ShellCheck | |
uses: ludeeus/action-shellcheck@master | |
- name: Run Perl::Critic | |
uses: natanlao/perl-critic-action@v1.1 | |
- name: Show docker compose version | |
run: docker compose version | |
- name: Validate docker-compose.yml | |
run: docker compose -f docker-compose.yml config | |
- name: Validate docker-compose_isolated_httpd.yml | |
run: docker compose -f docker-compose_isolated_httpd.yml config | |
docker: | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DHUB_USERNAME }} | |
password: ${{ secrets.DHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get commit SHA | |
run: | | |
curl --silent --fail --fail-early $GITHUB_API_URL/repos/vergoh/vnstat/commits/master | \ | |
jq -r .sha | \ | |
sed -e 's:^:latest_commit=:g' >> $GITHUB_ENV | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
with: | |
file: Dockerfile-dev | |
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 | |
push: true | |
tags: | | |
vergoh/vnstat:dev | |
ghcr.io/${{ github.repository_owner }}/vnstat:dev | |
labels: | | |
org.opencontainers.image.version=${{ env.latest_commit }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |