Make helper containers #342
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: Make helper containers | |
on: | |
schedule: | |
- cron: '0 2 ? * SUN' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build AUR enabled Arch containers | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "TODAY=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
- name: Generate version string | |
id: versionstring | |
run: echo "THIS_TAG=${{ env.TODAY }}.0.${{ github.run_number }}" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Create tag | |
uses: actions/github-script@v3 | |
with: | |
github-token: ${{ github.token }} | |
script: | | |
github.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: `refs/tags/${process.env.THIS_TAG}`, | |
sha: context.sha | |
}) | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: greyltc | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Build paru container | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64 | |
target: build-helper-img | |
push: true | |
context: . | |
build-args: | | |
HELPER=paru | |
AUR_USER=ab | |
tags: | | |
ghcr.io/greyltc-org/archlinux-aur:latest | |
ghcr.io/greyltc-org/archlinux-aur:${{ env.THIS_TAG }} | |
ghcr.io/greyltc-org/archlinux-aur:paru | |
ghcr.io/greyltc-org/archlinux-aur:paru-${{ env.THIS_TAG }} | |
greyltc/archlinux-aur:latest | |
greyltc/archlinux-aur:${{ env.TODAY }}.0.${{ github.run_number }} | |
greyltc/archlinux-aur:paru | |
greyltc/archlinux-aur:paru-${{ env.TODAY }}.0.${{ github.run_number }} | |
- | |
name: Build yay container | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64 | |
target: build-helper-img | |
push: true | |
context: . | |
build-args: | | |
HELPER=yay | |
AUR_USER=ab | |
tags: | | |
ghcr.io/greyltc-org/archlinux-aur:yay | |
ghcr.io/greyltc-org/archlinux-aur:yay-${{ env.THIS_TAG }} | |
greyltc/archlinux-aur:yay | |
greyltc/archlinux-aur:yay-${{ env.TODAY }}.0.${{ github.run_number }} | |
- | |
name: Trigger rebuild for direct descendants | |
run: | | |
TO_TRIGGER="docker-platformio | |
docker-otherthing | |
" | |
while read -r repo | |
do | |
printf "Triggering ${repo} build ...\n" | |
curl --silent \ | |
--url "https://api.github.com/repos/greyltc-org/${repo}/dispatches" \ | |
--header 'authorization: Bearer ${{ secrets.ROBOT_REPO_PAT }}' \ | |
--header "Accept: application/vnd.github.v3+json" \ | |
--data '{"event_type":"parent-change"}' \ | |
--output trigger_resp.json | |
cat trigger_resp.json | jq --raw-output '.' | |
done <<EOF | |
${TO_TRIGGER} | |
EOF |