2022-03-15 12:34:14 +01:00
|
|
|
name: 'Production deploy'
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy-to-netlify:
|
|
|
|
name: 'Deploy to Netlify'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-23 15:10:39 +01:00
|
|
|
- name: Checkout repository
|
2022-04-26 13:53:22 +02:00
|
|
|
uses: actions/checkout@v3.0.2
|
2022-03-15 12:34:14 +01:00
|
|
|
- name: Build and deploy to Netlify
|
2022-05-01 09:53:42 +02:00
|
|
|
uses: jsmrcaga/action-netlify-deploy@fb6a5f936a4b06a8f7793e69fc5a022ffe39807a
|
2022-03-15 12:34:14 +01:00
|
|
|
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
|
2022-05-03 13:13:16 +02:00
|
|
|
- name: Sign tar.gz
|
|
|
|
uses: actionhippie/gpgsign@4e28208b142cae93e1582401dcda1cf79e4f72c0
|
|
|
|
with:
|
|
|
|
private_key: ${{ secrets.GNUPG_KEY }}
|
|
|
|
passphrase: ${{ secrets.GNUPG_PASSPHRASE }}
|
|
|
|
detach_sign: true
|
|
|
|
files: cinny-${{ steps.vars.outputs.tag }}.tar.gz
|
2022-03-15 12:34:14 +01:00
|
|
|
- name: Upload tagged release
|
2022-05-01 09:53:42 +02:00
|
|
|
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
|
2022-03-15 12:34:14 +01:00
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
cinny-${{ steps.vars.outputs.tag }}.tar.gz
|
2022-05-03 13:13:16 +02:00
|
|
|
cinny-${{ steps.vars.outputs.tag }}.tar.gz.asc
|
2022-03-15 12:34:14 +01:00
|
|
|
|
|
|
|
push_to_dockerhub:
|
|
|
|
name: Push Docker image to Docker Hub
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-23 15:10:39 +01:00
|
|
|
- name: Checkout repository
|
2022-04-26 13:53:22 +02:00
|
|
|
uses: actions/checkout@v3.0.2
|
2022-03-15 12:34:14 +01:00
|
|
|
- name: Login to Docker Hub
|
2022-05-20 06:28:34 +02:00
|
|
|
uses: docker/login-action@v2.0.0
|
2022-03-15 12:34:14 +01:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
|
|
id: meta
|
2022-05-20 06:29:00 +02:00
|
|
|
uses: docker/metadata-action@v4.0.1
|
2022-03-15 12:34:14 +01:00
|
|
|
with:
|
|
|
|
images: ajbura/cinny
|
|
|
|
- name: Build and push Docker image
|
2022-03-15 12:46:58 +01:00
|
|
|
uses: docker/build-push-action@v2.10.0
|
2022-03-15 12:34:14 +01:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|