build-go-p4pack #250
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: 'build-go-p4pack' | |
on: | |
push: | |
branches: [main] | |
paths: | |
- 'build/go-p4pack/**' | |
pull_request: | |
branches: [main] | |
paths: | |
- 'build/go-p4pack/**' | |
schedule: | |
- cron: '1 1 * * *' # Run every day at 01:01 AM (UTC) | |
workflow_dispatch: | |
concurrency: | |
# if workflow for PR or push is already running stop it, and start new one | |
group: build-go-p4pack-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build_containers: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Login to GitHub Container Registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Go-P4Pack image build and push | |
if: github.event_name != 'pull_request' | |
run: | | |
build/go-p4pack/build.sh --push | |
- name: Go-P4Pack image build (TODO add export later) | |
if: github.event_name == 'pull_request' | |
run: | | |
build/go-p4pack/build.sh |