2022-03-15 11:34:14 +00:00
|
|
|
name: 'Production deploy'
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy-to-netlify:
|
|
|
|
name: 'Deploy to Netlify'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-23 14:10:39 +00:00
|
|
|
- name: Checkout repository
|
2022-04-19 04:04:33 +00:00
|
|
|
uses: actions/checkout@v3.0.1
|
2022-03-15 11:34:14 +00:00
|
|
|
- name: Build and deploy to Netlify
|
|
|
|
uses: jsmrcaga/action-netlify-deploy@v1.7.2
|
|
|
|
with:
|
|
|
|
install_command: "npm ci"
|
|
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
|
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
|
|
|
BUILD_DIRECTORY: "dist"
|
|
|
|
NETLIFY_DEPLOY_MESSAGE: "Prod deploy v${{ github.ref }}"
|
|
|
|
NETLIFY_DEPLOY_TO_PROD: true
|
|
|
|
- name: Get version from tag
|
|
|
|
id: vars
|
|
|
|
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
|
|
|
|
- name: Create tar.gz
|
|
|
|
run: tar -czvf cinny-${{ steps.vars.outputs.tag }}.tar.gz dist
|
|
|
|
- name: Upload tagged release
|
2022-03-23 14:10:39 +00:00
|
|
|
uses: softprops/action-gh-release@v0.1.14
|
2022-03-15 11:34:14 +00:00
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
cinny-${{ steps.vars.outputs.tag }}.tar.gz
|
|
|
|
|
|
|
|
push_to_dockerhub:
|
|
|
|
name: Push Docker image to Docker Hub
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-23 14:10:39 +00:00
|
|
|
- name: Checkout repository
|
2022-04-19 04:04:33 +00:00
|
|
|
uses: actions/checkout@v3.0.1
|
2022-04-19 06:33:02 +00:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1.2.0
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1.6.0
|
2022-03-15 11:34:14 +00:00
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v1.14.1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
|
|
id: meta
|
2022-04-12 04:44:31 +00:00
|
|
|
uses: docker/metadata-action@v3.7.0
|
2022-03-15 11:34:14 +00:00
|
|
|
with:
|
2022-04-19 06:33:02 +00:00
|
|
|
images: kfiven/cinny
|
2022-03-15 11:34:14 +00:00
|
|
|
- name: Build and push Docker image
|
2022-03-15 11:46:58 +00:00
|
|
|
uses: docker/build-push-action@v2.10.0
|
2022-03-15 11:34:14 +00:00
|
|
|
with:
|
|
|
|
context: .
|
2022-04-19 06:33:02 +00:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-03-15 11:34:14 +00:00
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|