Create build only if the config file exists in repo #28
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: prepare | |
on: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: backend/go.mod | |
- name: Verify code formatting | |
working-directory: ${{ github.workspace }}/backend | |
run: | | |
go install mvdan.cc/gofumpt@latest | |
test -z $(gofumpt -l .) | |
- name: Run linter | |
working-directory: ${{ github.workspace }}/backend | |
run: | | |
go install honnef.co/go/tools/cmd/staticcheck@latest | |
staticcheck ./... | |
- name: Run tests with coverage | |
working-directory: ${{ github.workspace }}/backend | |
run: go test -cover ./... | |
# deploy: | |
# name: Deploy | |
# runs-on: ubuntu-latest | |
# needs: prepare | |
# env: | |
# OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
# steps: | |
# - name: Clone repository | |
# uses: actions/checkout@v4 | |
# - name: Load secrets from 1Password | |
# uses: 1password/load-secrets-action@v2 | |
# with: | |
# # Export loaded secrets as environment variables | |
# export-env: true | |
# env: | |
# OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
# GCP_SERVICE_ACCOUNT_KEY: op://bee-ci/Google Cloud/service account key | |
# GCP_PROJECT_ID: op://bee-ci/Google Cloud/project id | |
# - name: Authenticate to gcloud | |
# uses: google-github-actions/auth@v2 | |
# with: | |
# credentials_json: ${{ env.GCP_SERVICE_ACCOUNT_KEY }} | |
# - name: Set up Cloud SDK | |
# uses: google-github-actions/setup-gcloud@v2 | |
# with: | |
# version: latest | |
# project_id: ${{ env.GCP_PROJECT_ID }} | |
# - name: Deploy to GCP | |
# working-directory: ${{ github.workspace }}/backend | |
# run: ./build-container |