... #34
Workflow file for this run
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: API Server CI/CD | |
on: | |
workflow_dispatch: | |
inputs: | |
deploy: | |
description: "Deploy? Set to true" | |
required: true | |
push: | |
paths: | |
- .github/workflows/apiserver.yml | |
- apiserver/** | |
jobs: | |
test: | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install eclint | |
run: npm install -g eclint | |
- name: Check EditorConfig compliance | |
run: eclint check $(git ls-files) apiserver | |
build_publish: | |
runs-on: ubuntu-24.04 | |
needs: test | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.2" | |
working-directory: apiserver | |
bundler-cache: true | |
env: | |
BUNDLE_DEPLOYMENT: "true" | |
BUNDLE_PATH: vendor/bundle | |
BUNDLE_JOBS: 4 | |
BUNDLE_RETRY: 3 | |
- name: Create tarball | |
run: > | |
tar | |
-c | |
--use-compress-program 'zstd -T0' | |
--sort name | |
--owner root:0 | |
--group root:0 | |
--mtime '2024-01-01 00:00Z' | |
--pax-option exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime | |
-f apiserver-{}.tar.zst | |
-C apiserver | |
. | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: apiserver | |
path: "*.tar.zst" | |
compression-level: 0 | |
deploy: | |
runs-on: ubuntu-24.04 | |
needs: build_publish | |
if: github.ref == 'refs/heads/hetzner' || github.event.inputs.deploy == 'true' | |
environment: deploy | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: apiserver | |
- name: Create tag | |
run: git tag -f v"$GITHUB_RUN_NUMBER" | |
- name: Push tag | |
run: git push origin v"$GITHUB_RUN_NUMBER" | |
- name: Create release | |
run: > | |
gh release create | |
v"$GITHUB_RUN_NUMBER" | |
apiserver-*.tar.zst | |
--title "v$GITHUB_RUN_NUMBER" | |
--notes-from-tag | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |