Skip to content

Commit

Permalink
ci: Add deployment step
Browse files Browse the repository at this point in the history
  • Loading branch information
flemzord committed Sep 25, 2024
1 parent 82f077b commit 7da9502
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 37 deletions.
32 changes: 31 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,34 @@ jobs:
GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
Deploy:
runs-on: "ubuntu-latest"
if: github.ref == 'refs/heads/main'
environment: staging
needs:
- GoReleaser
- Tests
steps:
- uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: "latest"
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: "Deploy in staging"
env:
TAG: ${{ github.sha }}
run: >
earthly
--no-output
+deploy-staging
--TAG=$TAG
41 changes: 6 additions & 35 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,9 @@ permissions:
contents: write

jobs:
Dirty:
runs-on: "ubuntu-latest"
steps:
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- name: Setup Env
uses: ./.github/actions/env
with:
token: ${{ secrets.NUMARY_GITHUB_TOKEN }}
- run: >
earthly
--allow-privileged
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+pre-commit
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
- name: Get changed files
id: changed-files
run: |
hasChanged=$(git status --porcelain)
if (( $(echo ${#hasChanged}) != 0 )); then
git status
echo "There are changes in the repository"
exit 1
fi
GoReleaser:
runs-on: "ubuntu-latest"
needs:
- Dirty
steps:
- uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: "latest"
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
Expand Down Expand Up @@ -71,4 +37,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
- name: Add the OpenAPI file to the release assets
run: >
gh release upload ${{github.ref_name}} ./openapi.yaml#openapi.yaml
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION 0.8
PROJECT FormanceHQ/payments

IMPORT github.com/formancehq/earthly:tags/v0.16.0 AS core
IMPORT github.com/formancehq/earthly:tags/v0.16.1 AS core

FROM core+base-image

Expand Down

0 comments on commit 7da9502

Please sign in to comment.