Skip to content

Terraform deployment fixes #17

Terraform deployment fixes

Terraform deployment fixes #17

Workflow file for this run

name: Test and Build
env:
IMAGE_NAME: ${{ vars.IMAGE_NAME || 'andrewlod767/authentication-api' }}
PROD_ENDPOINT: ${{ vars.PROD_ENDPOINT || '' }}
SV_PORT: ${{ vars.SV_PORT || '80' }}
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=sha
- name: Build
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
PROD_ENDPOINT=${{ env.PROD_ENDPOINT }}
SV_PORT=${{ env.SV_PORT }}