-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add github actions for on change, pr, cleanup
- Loading branch information
1 parent
90a2da3
commit 2565bad
Showing
4 changed files
with
88 additions
and
28 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,22 @@ | ||
name: Setup Action | ||
description: Set up environment, authenticate, and configure git for workflows under the kimyongbeom/peerprep-actions-runner container. | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Configure Git | ||
shell: bash | ||
run: | | ||
git config --global --add safe.directory "$PWD" | ||
- name: Decrypt Secret Files | ||
shell: bash | ||
run: | | ||
mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/sops/age | ||
echo $AGE_SECRET_KEY > ${XDG_CONFIG_HOME:-$HOME/.config}/sops/age/keys.txt | ||
/bin/bash ./scripts/secret.sh decrypt | ||
- name: Authenticate to Google Cloud | ||
shell: bash | ||
run: | | ||
make gcloud_auth |
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,46 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: Branch Cleanup | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# On push @ branch | ||
pull_request: | ||
types: [closed] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
cleanup: | ||
# Run only if PR is merged | ||
if: github.event.pull_request.merged == true | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
container: | ||
image: kimyongbeom/peerprep-actions-runner:latest | ||
env: | ||
AGE_SECRET_KEY: ${{ secrets.AGE_SECRET_KEY }} | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
options: --privileged | ||
|
||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/container_setup | ||
|
||
- name: Destroy Global Infrastructure | ||
shell: bash | ||
run: make destroy_infra | ||
|
||
- name: Destroy Backend | ||
shell: bash | ||
run: cd backend && make destroy | ||
|
||
- name: Destroy Frontend | ||
shell: bash | ||
run: . $NVM_DIR/nvm.sh && cd frontend && make destroy | ||
|
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