Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build via Docker in GitHub actions. #815

Closed
pompushko opened this issue Dec 8, 2024 · 1 comment
Closed

Build via Docker in GitHub actions. #815

pompushko opened this issue Dec 8, 2024 · 1 comment

Comments

@pompushko
Copy link

pompushko commented Dec 8, 2024

Hello

Does someone try to do that? Maybe someone can share yaml? I see that it possible via GitLab...
I found that possible with https://github.com/usimd/pi-gen-action but I have bit edited own fork of pi-gen, so Im not sure if possible to apply my changes

Thank you

@pompushko
Copy link
Author

Well
Here is my realization or here

name: Build Docker Image

on:
  workflow_dispatch:
  push:
    branches:
      - main
    paths-ignore:
      - '.github/**'
  pull_request:
    branches:
      - main
    paths-ignore:
      - '.github/**'

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y coreutils quilt parted qemu-user-static debootstrap zerofree zip dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc gpg pigz xxd arch-test

      - name: Build Docker image
        run: |
          chmod +x ./build-docker.sh
          ./build-docker.sh

      - name: Upload logs
        if: success()
        uses: actions/upload-artifact@v4
        with:
          name: build-logs
          path: deploy/build-docker.log
          retention-days: 7
          compression-level: 9

      - name: Authenticate to Google Cloud
        id: auth
        uses: google-github-actions/auth@v2
        with:
          credentials_json: ${{ secrets.GCR_SA_KEY }}

      - name: 'Set up Cloud SDK'
        uses: 'google-github-actions/setup-gcloud@v2'
        
      - name: 'Use gcloud CLI'
        run: 'gcloud info'

      - name: 'Upload image to GCP bucket'
        uses: 'google-github-actions/upload-cloud-storage@v2'
        with:
          path: 'deploy'
          destination: ${{ vars.GS_BUCKET }}
          glob: '*.zip'
          process_gcloudignore: false
          parent: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant