Assignment05 #1
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
on: | |
pull_request: | |
branches: | |
- main | |
types: [closed] | |
jobs: | |
my-action: | |
if: ${{ github.event.pull_request.merged }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: mirromutth/[email protected] | |
with: | |
character set server: 'utf8' | |
collation server: 'utf8_general_ci' | |
mysql version: '8.0' | |
mysql database: 'webapp' | |
mysql root password: ${{ secrets.PASSWORD }} | |
- uses: actions/checkout@v4 | |
- run: npm install | |
- name: Run tests | |
env: | |
USER: ${{ secrets.USER }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
HOST: ${{ secrets.HOST }} | |
run: npm test | |
- run: sudo rm -R node_modules | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v2' | |
- name: 'Use gcloud CLI' | |
run: 'gcloud info' | |
- name: Setup `packer` | |
uses: hashicorp/setup-packer@main | |
id: setup | |
with: | |
version: "latest" | |
- name: Run `packer init` | |
id: init | |
run: | | |
cd packer | |
packer init build.pkr.hcl | |
- run: | | |
cd packer | |
packer build -var-file=values.pkrvars.hcl build.pkr.hcl |