Skip to content

Commit

Permalink
fix: update checkout action and replace pat token
Browse files Browse the repository at this point in the history
  • Loading branch information
emnnipal committed Jun 4, 2022
1 parent 1fca9af commit 6bc69d1
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-app-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
# id: extract_branch

- name: Checkout ${{ inputs.branch }} branch
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/deploy-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ github.ref }} branch
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}

Expand All @@ -29,7 +29,7 @@ jobs:
run: pnpm lint

- name: Run tests
run: pnpm test
run: pnpm test -- --changed ${{ github.ref }}

deploy-to-dev:
name: Deploy React App to Dev
Expand All @@ -55,9 +55,10 @@ jobs:
tag: ${{ steps.changelog.outputs.tag }}
steps:
- name: Checkout main branch
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
ref: main
token: ${{ secrets.PAT }}

- id: changelog
name: Conventional Changelog
Expand All @@ -66,14 +67,14 @@ jobs:
git-message: 'chore(release): {version} [no ci]'
git-user-email: [email protected]
git-user-name: Emmanuel Nipal
github-token: ${{ secrets.PAT }}
github-token: ${{ secrets.GITHUB_TOKEN }}
output-file: 'false'

- name: Create Github Release
uses: actions/create-release@v1
if: ${{ steps.changelog.outputs.skipped == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/manual-deploy-dev.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/manual-deploy-staging.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/manual-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Manual deploy'
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy'
required: true
type: choice
default: 'dev'
options:
- dev
- staging

jobs:
manual-deploy-dev:
name: 'Deploy to Dev'
if: ${{ github.event.inputs.environment == 'dev' }}
uses: ./.github/workflows/deploy-app-workflow.yml
with:
environment: DEV
branch: ${{ github.ref }}
secrets:
app_env: ${{ secrets.DEV_APP_ENV }}
ssh_private_key: ${{ secrets.DEV_SSH_PRIVATE_KEY }}
ssh_host: ${{ secrets.DEV_SSH_HOST }}
ssh_user: ${{ secrets.SSH_USER }}

manual-deploy-staging:
name: 'Deploy to Staging'
if: ${{ github.event.inputs.environment == 'staging' }}
uses: ./.github/workflows/deploy-app-workflow.yml
with:
environment: STAGING
branch: ${{ github.ref }}
secrets:
app_env: ${{ secrets.STAGING_APP_ENV }}
ssh_private_key: ${{ secrets.STAGING_SSH_PRIVATE_KEY }}
ssh_host: ${{ secrets.STAGING_SSH_HOST }}
ssh_user: ${{ secrets.SSH_USER }}
2 changes: 1 addition & 1 deletion .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
pr-lint-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}

Expand Down

0 comments on commit 6bc69d1

Please sign in to comment.