Set GIT_PAGER if unset #93
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 and Upload | |
on: | |
push: | |
branches: ['main'] | |
workflow_dispatch: | |
inputs: | |
runs-on: | |
description: Type of machine to run the job on | |
required: true | |
type: choice | |
default: ubuntu-latest | |
options: | |
- dotfiles-public | |
- ubuntu-latest | |
jobs: | |
build_and_upload: | |
runs-on: ${{ inputs.runs-on || 'ubuntu-latest' }} | |
name: Build dotfiles tarball | |
# Add "id-token" with the intended permissions. | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
container: | |
image: python:3-slim | |
options: "-e BUILDKIT_HOST" | |
steps: | |
- name: Install git | |
run: | | |
set -ex | |
apt-get -yq update && apt install --no-install-recommends -yq git | |
- uses: actions/checkout@v4 | |
- name: Build tar file | |
run: | | |
set -ex | |
rm -rf dist && mkdir dist | |
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | |
python3 etc/build.py --no-upload --branch "$branch" --copy-to dist | |
- name: Final artifact summary | |
run: | | |
set -e | |
( | |
echo '## Artifact files' | |
echo '```sh' | |
ls -lh dist | |
echo '```' | |
) >> "$GITHUB_STEP_SUMMARY" | |
- name: "Authenticate to google cloud" | |
id: 'auth' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
workload_identity_provider: ${{ vars.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ vars.SERVICE_ACCOUNT }} | |
- name: 'Upload to public bucket' | |
uses: 'google-github-actions/upload-cloud-storage@v2' | |
with: | |
path: dist | |
parent: false | |
gzip: true | |
destination: 'nmk.nuimk.com' | |
process_gcloudignore: false |