Add basic build and publish workflow #5
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 gfx90a Docker image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - envs/x86/gfx90a/** | |
| - .github/workflows/build-gfx90a.yml | |
| - AGENTS.md | |
| - README.md | |
| pull_request: | |
| paths: | |
| - envs/x86/gfx90a/** | |
| - .github/workflows/build-gfx90a.yml | |
| - AGENTS.md | |
| - README.md | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build gfx90a image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Cache Docker layers | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-buildx-gfx90a-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-buildx-gfx90a- | |
| - name: Build docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: envs/x86/gfx90a/Dockerfile | |
| push: true | |
| tags: | | |
| higherordermethods/selfish:gfx90a | |
| higherordermethods/selfish:gfx90a-${{ github.sha }} | |
| cache-from: type=local,src=/tmp/.buildx-cache | |
| cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | |
| - name: Move cache | |
| run: | | |
| rm -rf /tmp/.buildx-cache | |
| mv /tmp/.buildx-cache-new /tmp/.buildx-cache |