Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deploy-please #40

Merged
merged 11 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/deploy-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy Please

on:
workflow_call:
inputs:
apps:
type: string
description: A comma-separated list of Scalingo apps to deploy. For example, "hedia-com-foo,hedia-dev-foo".
required: true
version:
type: string
description: The release version to deploy. For example, "v1.0.0". If not provided, the release that triggered the workflow will be used.
required: false

secrets:
HEDIA_BOT_GITHUB_PAT:
description: Needed to deploy to Scalingo
required: true
SCALINGO_TOKEN:
description: Needed to deploy to Scalingo
required: true

jobs:
deploy-please:
if: inputs.version || endsWith(github.ref_name, '.0.0') == false
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Download the Release
run: gh release download ${{ inputs.version || github.ref_name }} --archive=tar.gz
env:
GH_TOKEN: ${{ secrets.HEDIA_BOT_GITHUB_PAT }}

- name: Setup Scalingo CLI
run: |
curl -O https://cli-dl.scalingo.com/install &&
bash install &&
scalingo login --api-token ${{ secrets.SCALINGO_TOKEN }}

- name: Deploy to Scalingo
run: |
for app in ${APPS//,/ }
do
scalingo --app $app deploy --no-follow "${REPO}-${VERSION:1}.tar.gz" $VERSION
done
env:
APPS: ${{ inputs.apps }}
REPO: ${{ github.event.repository.name }}
VERSION: ${{ inputs.version || github.ref_name }}
3 changes: 2 additions & 1 deletion .github/workflows/dockerize-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
description: The tag to use for the Docker image
required: false
default: latest

secrets:
READONLY_NPM_TOKEN:
description: Needed to install private @hedia npm packages
Expand All @@ -28,12 +29,12 @@ permissions:
jobs:
dockerize-please:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ inputs.github_ref || inputs.tag_name }}
fetch-depth: 1

- name: Create .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.READONLY_NPM_TOKEN }}" > .npmrc
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
jobs:
issue:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Link Project
uses: actions/add-to-project@releases/v1
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/publish-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
description: The git ref to publish
type: string
required: true

secrets:
READONLY_NPM_TOKEN:
description: Needed to install private @hedia npm packages
Expand All @@ -18,14 +19,12 @@ on:
jobs:
publish-please:
runs-on: ubuntu-latest
timeout-minutes: 10

timeout-minutes: 5
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.github_ref }}
fetch-depth: 1

- name: Setup Node.js Environment
uses: actions/setup-node@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
type: string
description: A comma-separated list of GitHub teams to request a review from.
required: false

secrets:
HEDIA_BOT_GITHUB_PAT:
description: Needed to link project
Expand All @@ -26,6 +27,7 @@ on:
jobs:
pull-request:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- id: link-project
name: Link Project
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
tag_name:
description: "The tag name (version number) of the release created"
value: ${{ jobs.release-please.outputs.tag_name }}

secrets:
HEDIA_BOT_GITHUB_PAT:
description: Needed to run release-please
Expand All @@ -21,6 +22,7 @@ permissions:
jobs:
release-please:
runs-on: ubuntu-latest
timeout-minutes: 5
if: >
github.event_name == 'workflow_dispatch' ||
(
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ permissions:
jobs:
update-please:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down