Skip to content

Release to staging #1

Release to staging

Release to staging #1

name: Release to staging
on:
workflow_dispatch:
concurrency:
group: deploy-staging
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- id: version-tag
name: Create release version
run: |
VERSION=$(date +%y.%m.%d).${{ github.run_number }}
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- name: Copy config from develop to staging
run: |
git config --global user.name "Release manager"
git config --global user.email "<>"
cp config/develop.json config/staging.json
git add config/staging.json
git commit -m "Release v${{ steps.version-tag.outputs.VERSION }}"
git push
- name: Create tag and release
run: |
git tag "v${{ steps.version-tag.outputs.VERSION }}" -m "Release ${{ steps.version-tag.outputs.VERSION }}"
git push origin --tags
gh release create "v${{ steps.version-tag.outputs.VERSION }}" --title "${{ steps.version-tag.outputs.VERSION }}" --draft --generate-notes --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
runs-on: ubuntu-latest
needs:
- release
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Deploy
uses: ./.github/actions/deploy
with:
config: staging.json
environment: staging
test:
runs-on: ubuntu-latest
needs:
- deploy
steps:
- uses: actions/checkout@v4
- name: Test
uses: ./.github/actions/test
with:
domain: https://develop.tna.dblclk.dev # TODO: Change