Adicionado o portal do gnome #5
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: Build e Push da Imagem Bootc | |
| on: | |
| schedule: | |
| - cron: '0 5 * * *' | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - 'README.md' | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ferlinuxdebian/sway-bootc | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout do código | |
| uses: actions/checkout@v4 | |
| - name: Liberar espaço em disco | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \ | |
| "/usr/local/share/boost" "$AGENT_TOOLSDIRECTORY" | |
| - name: Gerar metadados do build | |
| id: meta | |
| run: | | |
| VERSION=$(grep '^FROM' Containerfile | head -n 1 | awk -F: '{print $2}' | awk '{print $1}') | |
| DATE=$(TZ='America/Sao_Paulo' date +'%Y%m%d-%H%M') | |
| SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7) | |
| PRIMARY="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION}-${DATE}" | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| echo "date=${DATE}" >> $GITHUB_OUTPUT | |
| echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT | |
| echo "primary=${PRIMARY}" >> $GITHUB_OUTPUT | |
| - name: Login no GHCR | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | buildah login \ | |
| -u "${{ github.actor }}" --password-stdin "${{ env.REGISTRY }}" | |
| - name: Build da imagem | |
| run: | | |
| buildah build \ | |
| --skip-unused-stages=false \ | |
| --security-opt label=disable \ | |
| -t "${{ steps.meta.outputs.primary }}" \ | |
| -f Containerfile \ | |
| -v "$(pwd):/run/src" \ | |
| . | |
| - name: Push da tag principal | |
| run: buildah push "${{ steps.meta.outputs.primary }}" | |
| - name: Aplicar tags adicionais via skopeo | |
| run: | | |
| VERSION="${{ steps.meta.outputs.version }}" | |
| SHORT_SHA="${{ steps.meta.outputs.short_sha }}" | |
| BASE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | |
| CREDS="${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}" | |
| for TAG in "${VERSION}-latest" "latest" "main" "sha-${SHORT_SHA}"; do | |
| echo "→ Copiando manifesto para :${TAG}" | |
| skopeo copy \ | |
| --src-creds "${CREDS}" \ | |
| --dest-creds "${CREDS}" \ | |
| "docker://${{ steps.meta.outputs.primary }}" \ | |
| "docker://${BASE}:${TAG}" | |
| done |