Skip to content

Merge pull request #14 from spectrocloud/sudkul87-patch-1 #38

Merge pull request #14 from spectrocloud/sudkul87-patch-1

Merge pull request #14 from spectrocloud/sudkul87-patch-1 #38

Workflow file for this run

name: Release to Production
on:
push:
branches: [ main ]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
docker:
name: "Release Docker image"
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.version.outputs.version }}
steps:
- id: checkout
name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- id: version
name: Determine Release Version
run: |
npm install @semantic-release/exec -D
npm install @semantic-release/changelog -D
npm install @semantic-release/git -D
npx semantic-release --dry-run
cat VERSION.env
source VERSION.env
echo "::set-output name=version::$VERSION"
- name: Set up QEMU
if: ${{ steps.version.outputs.VERSION != ''}}
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: ${{ steps.version.outputs.VERSION != ''}}
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
if: ${{ steps.version.outputs.VERSION != ''}}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
if: ${{ steps.version.outputs.VERSION != ''}}
uses: docker/build-push-action@v2
with:
context: .
build-args: VERSION=${{steps.version.outputs.VERSION}}
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository }}:${{steps.version.outputs.VERSION}}
docker-reverse-proxy:
name: "Docker w/Proxy image"
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.version.outputs.version }}
steps:
- id: checkout
name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- id: version
name: Determine Release Version
run: |
npm install @semantic-release/exec -D
npm install @semantic-release/changelog -D
npm install @semantic-release/git -D
npx semantic-release --dry-run
cat VERSION.env
source VERSION.env
echo "::set-output name=version::$VERSION"
- name: Set up QEMU
if: ${{ steps.version.outputs.VERSION != ''}}
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: ${{ steps.version.outputs.VERSION != ''}}
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
if: ${{ steps.version.outputs.VERSION != ''}}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
if: ${{ steps.version.outputs.VERSION != ''}}
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile.Caddy
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository }}:${{steps.version.outputs.VERSION}}-proxy
release:
name: "Release"
needs: [docker,docker-reverse-proxy]
runs-on: ubuntu-latest
steps:
- id: checkout
name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: "release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release