preserve timestamp on patched file #147
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: apps/blog | |
"on": | |
push: | |
branches: main | |
paths: | |
- apps/blog/** | |
concurrency: apps/blog | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/augustfengd/augustfeng.app/toolchain:latest | |
options: --user 1001 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: install just | |
uses: extractions/setup-just@v1 | |
- name: just lint | |
run: just lint | |
working-directory: apps/blog | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/augustfengd/augustfeng.app/toolchain:latest | |
needs: | |
- lint | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: make all | |
run: make all | |
working-directory: apps/blog | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: blog | |
path: apps/blog/build/ | |
push: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: docker login | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
- uses: actions/download-artifact@v3 | |
with: | |
name: blog | |
path: apps/blog/build/ | |
- name: make docker.push | |
run: make docker.push | |
working-directory: apps/blog | |
- name: make docker.pull | |
run: make docker.pull | |
working-directory: apps/blog | |
- name: make digest.cue | |
uses: docker://ghcr.io/augustfengd/augustfeng.app/toolchain | |
with: | |
args: make -C apps/blog digest.cue | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: digest | |
path: apps/blog/digest.cue | |
apply: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/augustfengd/augustfeng.app/toolchain:latest | |
needs: | |
- push | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: configure google application credentials | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} | |
- name: install gcloud | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: gcloud components install gke-gcloud-auth-plugin | |
run: 'gcloud components install gke-gcloud-auth-plugin ' | |
- name: gcloud container clusters get-credentials augustfeng-app | |
run: gcloud container clusters get-credentials augustfeng-app --zone=us-east1-b | |
- uses: actions/download-artifact@v3 | |
with: | |
name: digest | |
path: apps/blog | |
- name: cue cmd apply github.com/augustfengd/augustfeng.app/apps/blog | |
run: cue cmd apply github.com/augustfengd/augustfeng.app/apps/blog |