diff --git a/.github/workflows/one.yaml b/.github/workflows/one.yaml new file mode 100644 index 0000000..41536df --- /dev/null +++ b/.github/workflows/one.yaml @@ -0,0 +1,73 @@ +name: Build just one package and push it to repo +concurrency: + group: "one-build" + #cancel-in-progress: true + +on: + workflow_dispatch: + inputs: + package: + description: 'Package to build' + required: true + arch: + required: false + default: "amd64" + description: 'Arch to build for' +jobs: + build: + runs-on: ubuntu-latest + env: + ARCH: ${{ github.event.inputs.arch }} + steps: + - name: Set final repo + run: | + FINAL_REPO=quay.io/kairos/packages + if [[ "${{ github.event.inputs.arch }}" == "arm64"; then + FINAL_REPO=quay.io/kairos/packages-arm64 + fi + + echo "FINAL_REPO=$FINAL_REPO" >> "$GITHUB_ENV" + echo "$GITHUB_ENV" + - uses: actions/checkout@v3 + - run: | + git fetch --prune --unshallow + mkdir build + - name: Download meta 🔧 + uses: luet-lab/luet-github-action@master + with: + FINAL_REPO: ${{ env.action_state }} + REPOSITORY_TYPE: docker + downloadAllMeta: true + downloadFromList: true + downloadMeta: true + - name: Release space from worker + run: | + sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android + sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET + - name: Build packages 🔧 + uses: luet-lab/luet-github-action@master + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + build: true + fromIndex: true + onlyMissing: false + CURRENT_PACKAGE: ${{ github.event.inputs.package }} + FINAL_REPO: ${{ env.action_state }} + DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.QUAY_PASSWORD }} + DOCKER_ENDPOINT: quay.io + REPOSITORY_TYPE: docker + pushFinalImages: true + pushCache: true + values: values/${{ github.event.inputs.arch }}.yaml + - name: Create repo 🔧 + uses: luet-lab/luet-github-action@master + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + FINAL_REPO: ${{ env.action_state }} + DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.QUAY_PASSWORD }} + DOCKER_ENDPOINT: quay.io + REPOSITORY_TYPE: docker + createRepo: true + pushCache: true