Last active
February 3, 2025 13:12
-
-
Save badnetmask/d570cfdc4893fdf9a3f56629d98198f0 to your computer and use it in GitHub Desktop.
Supporting material for my blog post: https://mteixeira.wordpress.com/2025/02/03/my-self-hosted-forgejo-runner-setup/
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: EE build single node | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # Uncomment to run only when specific files change | |
| # paths: | |
| # - '**/ansible-navigator.yaml' | |
| # - '**/execution-environment.yml' | |
| env: | |
| # Set this to the public IP or hostname of your registry, | |
| # whichever you use to reach it from your desktop/laptop | |
| FORGEJO_HOST: forgejo.lab.home.arpa | |
| CONTAINER_NAME: homelab-ee-single | |
| jobs: | |
| build-and-push-arch: | |
| runs-on: catthehacker-amd64 | |
| environment: deploy | |
| steps: | |
| - name: Prepare environment variables | |
| run: | | |
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
| echo REGISTRY=${{ env.FORGEJO_HOST }} >> $GITHUB_ENV | |
| - name: Checkout the repo | |
| uses: actions/checkout@v4 | |
| - name: Install requirements | |
| run: | | |
| pip install -r requirements.txt | |
| - name: Generate the Ansible Builder context | |
| run: | | |
| ansible-builder create -v 3 | |
| - name: Login to the registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.PACKAGE_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| config-inline: | | |
| [registry."${{ env.REGISTRY }}"] | |
| ca=["/usr/local/share/ca-certificates/homelab-ca.crt"] | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: context | |
| push: true | |
| provenance: false | |
| platforms: linux/amd64, linux/arm64 | |
| tags: ${{ env.REGISTRY }}/${{ github.actor }}/${{ env.CONTAINER_NAME }}:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment