Skip to content

Commit

Permalink
Changed secrets and updated worflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsproul committed Aug 5, 2024
1 parent 0ba19c7 commit 6cef6e6
Showing 1 changed file with 34 additions and 40 deletions.
74 changes: 34 additions & 40 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,39 @@
name: github actions

on:
push:
branches:
- 'gitactions'
push:
branches:
- "gitactions"

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: code checkout
uses: actions/checkout@v2

- name: install the gcloud cli
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GOOGLE_PROJECT }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
export_default_credentials: true

- name: build and push the docker image
env:
GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }}
run: |
gcloud auth configure-docker us-east1-docker.pkg.dev
docker build -t us-east1-docker.pkg.dev/clone-build-registry/clone-build-registry/nginx:latest .
docker push us-east1-docker.pkg.dev/clone-build-registry/clone-build-registry/nginx:latest
- name: install python
uses: actions/setup-python@v2
with:
python-version: '3.12.3'

- name: install dependencies
run:
pip install -e '.[dev]'

- name: run pytest
run:
pytest




deploy:
runs-on: ubuntu-latest
steps:
- name: code checkout
uses: actions/checkout@v2

- name: install the gcloud cli
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GOOGLE_PROJECT }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
export_default_credentials: true

- name: build and push the docker image
env:
GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }}
run: |
gcloud auth configure-docker us-east1-docker.pkg.dev
docker build -t us-east1-docker.pkg.dev/${{ secrets.GOOGLE_PROJECT }}/cbr-testing/nginx:latest .
docker push us-east1-docker.pkg.dev/${{ secrets.GOOGLE_PROJECT }}/cbr-testing/nginx:latest
- name: install python
uses: actions/setup-python@v2
with:
python-version: "3.12.3"

- name: install dependencies
run: pip install -e '.[dev]'

- name: run pytest
run: pytest

0 comments on commit 6cef6e6

Please sign in to comment.