-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Victor Hang <[email protected]>
- Loading branch information
Showing
7 changed files
with
166 additions
and
58 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Build KaaSix | ||
on: | ||
push: | ||
tags: | ||
- 'kaasix-v*.*.*' | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
pre_job: | ||
# continue-on-error: true # Uncomment once integration is finished | ||
runs-on: didactiklabs-runners | ||
# Map a step output to a job output | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@master | ||
with: | ||
# All of these options are optional, so you can remove them if you are happy with the defaults | ||
concurrent_skipping: 'never' | ||
skip_after_successful_duplicate: 'true' | ||
paths_ignore: '["**/README.md", "**/docs/**"]' | ||
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' | ||
build: | ||
needs: pre_job | ||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
android: true | ||
dotnet: true | ||
haskell: false | ||
large-packages: false | ||
docker-images: false | ||
swap-storage: true | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set output | ||
id: vars | ||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
- name: Get Nixpkgs revision for nixfmt | ||
run: | | ||
# This should not be a URL, because it would allow PRs to run arbitrary code in CI! | ||
url=$(jq -r .pins.nixpkgs.url npins/sources.json) | ||
echo "url=$url" >> "$GITHUB_ENV" | ||
- uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27 | ||
with: | ||
nix_path: nixpkgs=${{ env.url }} | ||
extra_nix_config: | | ||
fallback = true | ||
trusted-public-keys = didactiklabs-nixcache:PxLKN0+ZkP07M8g8/B6xbP6A4MYpqQg6LH7V3muiy/0= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | ||
substituters = https://s3.didactiklabs.io/nix-cache https://cache.nixos.org/ | ||
- name: Auth to s3 cache | ||
run: | | ||
aws --profile default configure set aws_access_key_id "${{ secrets.AWS_ACCESS_KEY_ID }}" | ||
aws --profile default configure set aws_secret_access_key "${{ secrets.AWS_SECRET_ACCESS_KEY_ID }}" | ||
- name: 'Set up skopeo' | ||
uses: warjiang/[email protected] | ||
- id: 'auth' | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
credentials_json: '${{ secrets.GCLOUD_AUTH_CREDENTIAL_FILE }}' | ||
- name: Build and Push | ||
run: | | ||
nix-shell shell.nix --run "buildOciQcow2 kaasix" | ||
skopeo --version | ||
skopeo copy \ | ||
docker-archive:output/kaasix-qcow2-oci.tar \ | ||
docker://gcr.io/${{ secrets.GCLOUD_PROJECT }}/kaasix-$(nix eval --raw -f . nixosSystem.config.customNixOSModules.kubernetes.version.kubeadm --argstr profile kaasix):${{ steps.vars.outputs.tag }} |
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
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
File renamed without changes.
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
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
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