Switch to Semaphore Noir #141
Workflow file for this run
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 Support Dockerfile | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| - hacknet | |
| push: | |
| branches: | |
| - main | |
| - hacknet | |
| env: | |
| DOCKERFILE_PATH: crates/support/Dockerfile | |
| IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/e3-support | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build: | |
| name: Build & Push Image | |
| runs-on: ubuntu-latest | |
| outputs: | |
| image_tag: ${{ steps.version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Generate version tag | |
| id: version | |
| run: | | |
| echo "version=$(git rev-parse --short=9 HEAD)" >> $GITHUB_OUTPUT | |
| - name: Generate tags | |
| id: tags | |
| run: | | |
| VERSION=$(git rev-parse --short=9 HEAD) | |
| TAGS="${{ env.IMAGE_NAME }}:$VERSION" | |
| if [ "${{ github.ref }}" = "refs/heads/main" ]; then | |
| TAGS="$TAGS,${{ env.IMAGE_NAME }}:latest" | |
| elif [ "${{ github.ref }}" = "refs/heads/hacknet" ]; then | |
| TAGS="$TAGS,${{ env.IMAGE_NAME }}:hacknet" | |
| fi | |
| echo "tags=$TAGS" >> $GITHUB_OUTPUT | |
| - name: Set up BuildKit | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./crates/support | |
| file: ${{ env.DOCKERFILE_PATH }} | |
| push: true | |
| tags: ${{ steps.tags.outputs.tags }} | |
| cache-from: | | |
| type=gha,scope=cargo-registry | |
| type=gha,scope=cargo-git | |
| type=gha,scope=cargo-target | |
| type=gha,scope=buildcache | |
| cache-to: | | |
| type=gha,mode=max,scope=cargo-registry | |
| type=gha,mode=max,scope=cargo-git | |
| type=gha,mode=max,scope=cargo-target | |
| type=gha,mode=max,scope=buildcache |