Update screenshot #6
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
| name: build | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| - name: Run tests | |
| run: go test -v ./... | |
| - name: Run lint | |
| uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: v2.11.4 | |
| build-images: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v1 | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Available platforms | |
| run: echo ${{ steps.buildx.outputs.platforms }} | |
| - name: Build and deploy master image to ghcr.io and dockerhub | |
| if: ${{ github.ref == 'refs/heads/master' }} | |
| env: | |
| GITHUB_PACKAGE_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| USERNAME: ${{ github.actor }} | |
| GITHUB_SHA: ${{ github.sha }} | |
| GITHUB_REF: ${{ github.ref }} | |
| run: | | |
| ref="$(echo ${GITHUB_REF} | cut -d'/' -f3)" | |
| echo "VERSION=${ref}, COMMIT_HASH=${GITHUB_SHA}" | |
| echo ${GITHUB_PACKAGE_TOKEN} | docker login ghcr.io -u ${USERNAME} --password-stdin | |
| echo ${DOCKER_HUB_TOKEN} | docker login -u ${USERNAME} --password-stdin | |
| docker buildx build --push \ | |
| --build-arg CI=github --build-arg VERSION=${ref} --build-arg COMMIT_HASH=${GITHUB_SHA} \ | |
| --platform linux/amd64,linux/arm/v7,linux/arm64 \ | |
| -t ghcr.io/dotzero/pad:${ref} -t ghcr.io/dotzero/pad:latest \ | |
| -t dotzero/pad:${ref} -t dotzero/pad:latest . |