Skip to content

Commit

Permalink
✨ workflow for building nginx image
Browse files Browse the repository at this point in the history
  • Loading branch information
Shion1305 committed Apr 14, 2024
1 parent 368c7df commit 1d27739
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/deploy-nginx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build&Push Nginx image to GAR
on:
push:
branches:
- main
paths:
- 'docker/nginx/**'
- '.github/workflows/deploy-nginx.yaml'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
token_format: access_token
workload_identity_provider: 'projects/228944830644/locations/global/workloadIdentityPools/gh-pool/providers/provider-github'
service_account: '[email protected]'

- name: Authorize Docker
id: docker-auth
uses: docker/login-action@v3
with:
username: 'oauth2accesstoken'
password: ${{ steps.auth.outputs.access_token }}
registry: asia-northeast1-docker.pkg.dev

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
push: true
tags: asia-northeast1-docker.pkg.dev/lgtmgen-project/dev-main/nginx:latest
file: ./docker/nginx/Dockerfile
context: ./docker/nginx

0 comments on commit 1d27739

Please sign in to comment.