v2.334.0 #28
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 Publish | |
| on: | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| release: | |
| runs-on: ubuntu-22.04 | |
| 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 Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Set repository info | |
| run: | | |
| if [[ -z "${{ env.repository_name }}" ]]; then | |
| echo "::notice title=Unresolved GH context::GitHub context for 'repository.name' did not resolve" | |
| REPO_NAME="${GITHUB_REPOSITORY}" | |
| else | |
| REPO_NAME="${{ env.repository_name }}" | |
| fi | |
| if [ -z "$REPO_NAME" ]; then | |
| echo "::warning title=Unresolved key::Guard rail for repository name failed, using fallback." | |
| echo "REPO_NAME=thevickypedia/github-runner-linux" >> $GITHUB_ENV | |
| else | |
| echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV | |
| fi | |
| if [[ -z "${{ env.repository_desc }}" ]]; then | |
| echo "::notice title=Unresolved GH context::GitHub context for 'repository.description' did not resolve" | |
| echo REPO_DESCRIPTION="Spin up an on-demand self-hosted GitHub action runner with multi-arch supported Ubuntu image." >> $GITHUB_ENV | |
| else | |
| echo REPO_DESCRIPTION="${{ env.repository_desc }}" >> $GITHUB_ENV | |
| fi | |
| shell: bash | |
| env: | |
| repository_name: "${{ github.repository.name }}" | |
| repository_desc: "${{ github.repository.description }}" | |
| - name: Check repository info | |
| run: | | |
| echo "::notice title=Repository Name::${{ env.REPO_NAME }}" | |
| echo "::notice title=Repository Description::${{ env.REPO_DESCRIPTION }}" | |
| shell: bash | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: ${{ github.repository }}:${{ github.event.release.tag_name }},${{ github.repository }}:latest | |
| - name: Update description | |
| uses: thevickypedia/describe-docker@v1 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| summary: "${{ env.REPO_DESCRIPTION }}" | |
| repository: "${{ env.REPO_NAME }}" | |
| filename: "README.md" |