Skip to content

Merge pull request #1846 from dev-launchers/development/ideaspace #496

Merge pull request #1846 from dev-launchers/development/ideaspace

Merge pull request #1846 from dev-launchers/development/ideaspace #496

Workflow file for this run

name: staging-image
on:
push:
branches:
- master
paths-ignore:
# Ignore when changes is made by flux
- 'staging/**'
- 'production/**'
# Ignore markdown files
- '**/*.md'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# https://stackoverflow.com/questions/60942067/get-current-date-and-time-in-github-workflows
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M')"
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: devlaunchers/platform-website # list of Docker images to use as base name for tags
# generate Docker tags based on the following events/attributes
# flux image update policy sorts by timestamp
tags: |
type=raw,value={{sha}}-${{ steps.date.outputs.date }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
NODE_ENV=staging