Release version 1.20250412.11 #3
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 and Push to GHCR | |
| on: | |
| push: | |
| #branches: | |
| # - master | |
| # Publish semver tags as releases. | |
| tags: [ 'v*.*.*' ] | |
| pull_request: | |
| branches: [ "master" ] | |
| env: | |
| # Use docker.io for Docker Hub if empty | |
| REGISTRY: ghcr.io | |
| # github.repository as <account>/<repo> | |
| IMAGE_NAME: ${{ github.repository }} | |
| ORG_NAME: league-infrastructure | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| steps: | |
| # Step 1: Check out the repository | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| # Step 2: Install devcontainers CLI | |
| - name: Install devcontainers CLI | |
| run: npm install -g @devcontainers/cli | |
| # Step 3: Log in to GitHub Container Registry | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set Image Tag | |
| id: image_tag | |
| run: | | |
| TAG=$(echo "${GITHUB_REF}" | sed 's|refs/tags/||') | |
| echo "TAG=${TAG}" >> $GITHUB_ENV | |
| echo "LATEST_TAG=true" >> $GITHUB_ENV | |
| shell: bash | |
| # Step 4: Build the Dev Container image | |
| - name: Build Dev Container image | |
| run: | | |
| devcontainer build --workspace-folder . --image-name ${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} | |
| # Step 5: Tag image as latest | |
| - name: Tag image as latest | |
| run: | | |
| docker tag ${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} \ | |
| ${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest | |
| # Step 6: Push Docker image | |
| - name: Push Docker image | |
| run: | | |
| docker push ${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} | |
| docker push ${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:latest |