ci #195
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: ci | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }} | |
cancel-in-progress: true | |
on: # yamllint disable-line rule:truthy | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: | |
- master | |
- develop | |
schedule: | |
- cron: "0 9 * * *" # Every day at 9am UTC | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- 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 | |
if: github.ref_name == 'master' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Convert slash in branch name | |
run: | | |
BRANCH_NAME=$(echo ${{ github.head_ref }} | tr / -) | |
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV | |
- name: Build${{ github.ref_name == 'master' && ' and push' || '' }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: ${{ github.ref_name == 'master'}} | |
tags: docker.io/moulick/debug-image:${{ github.ref_name == 'master' && 'latest' || env.BRANCH_NAME }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |