Skip to content

Commit

Permalink
Create build-production.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yukiko-bass authored Oct 10, 2023
1 parent 01edab5 commit 207e4f9
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and push the tagged build to production

on:
push:
tags:
- 'v*'

jobs:
build_push_image:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Fetch latest version
id: fetch_version
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}

- name: Docker Login
uses: docker/login-action@v3.0.0
with:
registry: ${{ secrets.ACR_NAME }}
username: ${{ secrets.ACR_LOGIN }}
password: ${{ secrets.ACR_LOGIN }}

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

- name: Build and push production images
uses: docker/build-push-action@v5.0.0
with:
context: .
push: true
tags: ${{secrets.ACR_NAME}}/contoso-website:latest,${{secrets.ACR_NAME}}/contoso-website:${{ steps.fetch_version.outputs.TAG }}

0 comments on commit 207e4f9

Please sign in to comment.