Actions Runner Controller Demo #2
This file contains 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: Actions Runner Controller Demo | |
on: | |
workflow_dispatch: | |
jobs: | |
Explore-GitHub-Actions: | |
runs-on: arc-runner-set | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- run: echo "🎉 This job uses runner scale set runners!" | |
- name: Check out source code | |
uses: actions/checkout@v4 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Compile and test | |
run: ./gradlew clean build | |
- name: Package as OCI image | |
run: ./gradlew bootBuildImage --imageName ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} | |
- name: Authenticate with the container registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ${{ env.REGISTRY }} | |
- name: Publish OCI image | |
run: | | |
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} | |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest |