Skip to content

Optimize Dockerfile build process by removing package upgrade #18

Optimize Dockerfile build process by removing package upgrade

Optimize Dockerfile build process by removing package upgrade #18

Workflow file for this run

name: gol2
on:
push:
branches:
- 'dev'
- 'snapshot'
workflow_dispatch:
jobs:
Build:
runs-on: ubuntu-latest
outputs:
image: ${{ steps.meta.outputs.tags }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: europe-west9-docker.pkg.dev/gol2-development/gol2/dev
flavor: latest=false
tags: |
type=ref,suffix=-{{sha}},event=branch
type=ref,suffix=-{{sha}},event=pr
- uses: 'google-github-actions/auth@v2'
id: auth
with:
token_format: access_token
project_id: 'gol2-development'
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
- name: Login to GAR
uses: docker/login-action@v3
with:
registry: europe-west9-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Build and push
uses: docker/build-push-action@v5
with:
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Deploy-dev:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/dev'
needs: Build
runs-on: ubuntu-latest
env:
image: ${{ needs.Build.outputs.image }}
steps:
- uses: 'google-github-actions/auth@v2'
id: auth
with:
token_format: access_token
project_id: 'gol2-development'
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
- name: Deploy to Cloud Run
uses: google-github-actions/deploy-cloudrun@v2
with:
service: gol2
image: ${{ env.image }}
region: europe-west9