Release to staging #1
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
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 |