Skip to content

Build

Build #941

Workflow file for this run

on: {push: {branches: [main]}, schedule: [{cron: '13 22 * * *'}], workflow_dispatch: {}}
name: Build
jobs:
setup:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.version.outputs.tag }}
steps:
- name: Generate version tag
id: version
run: |
echo "tag=$(date +%s)" >> $GITHUB_OUTPUT
build_base:
needs: [setup]
runs-on: ubuntu-latest
permissions: {packages: write, contents: write}
continue-on-error: true
concurrency: 'python3-alpine'
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- name: Setup workspace
run: |
mkdir -p ${{ github.workspace }}/work
cp apko-base.yaml ${{ github.workspace }}/work/
- name: Build container
run: |
docker run \
--entrypoint /bin/sh \
-i \
-v ${{ github.workspace }}/work:/work \
ghcr.io/wolfi-dev/apko \
-c "$(cat <<"EOF"
echo '${{ secrets.GITHUB_TOKEN }}' | apko login -u ${{ github.repository_owner }} --password-stdin --password-stdin ghcr.io
apko publish --debug --arch x86_64,arm64 apko-base.yaml ghcr.io/infrabits/python3-alpine:latest-${{ needs.setup.outputs.tag }}
EOF
)"
- uses: imjasonh/[email protected]
- name: Update latest tag
run: |
echo '${{ secrets.GITHUB_TOKEN }}' | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
crane cp ghcr.io/infrabits/python3-alpine:latest-${{ needs.setup.outputs.tag }} ghcr.io/infrabits/python3-alpine:latest
tag:
runs-on: ubuntu-20.04
needs: [setup, build_base]
steps:
- name: Create GitHub release
uses: actions/github-script@v6
with:
script: |
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Release ${{ needs.setup.outputs.tag }}',
tag_name: 'latest-${{ needs.setup.outputs.tag }}',
draft: false,
prerelease: false,
})