feat: update GitHub API key handling; support multiple keys and add r… #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node.js CI | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
jobs: | |
buildTest: | |
name: Build and push to dockerhub using develop tag | |
if: ${{ github.ref == 'refs/heads/develop' && github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: governify/zh2gh:develop | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
buildProdAndRelease: | |
name: Release, build and push to dockerhub using tag version | |
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push'}} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Conventional Changelog | |
id: changelog | |
uses: TriPSs/conventional-changelog-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
output-file: 'CHANGELOG.md' | |
tag-prefix: 'v' | |
release-count: 0 | |
package-json: './package.json' | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
with: | |
tag_name: ${{ steps.changelog.outputs.tag }} | |
release_name: ${{ steps.changelog.outputs.tag }} | |
body: ${{ steps.changelog.outputs.clean_changelog }} | |
- name: Sync develop with main | |
uses: repo-sync/pull-request@v2 | |
with: | |
source_branch: "main" | |
destination_branch: "develop" | |
pr_title: "Synchronize develop with master after release ${{ steps.changelog.outputs.tag }}" | |
pr_body: ":crown:" | |
pr_reviewer: "pafmon" | |
pr_assignee: "cesgarpas" | |
pr_label: "auto-pr" | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: AutoModality/action-clean@v1 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: governify/zh2gh:${{ steps.changelog.outputs.tag }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |