admin - deploy #15
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: admin - deploy | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: sergeysova/jq-action@v2 | |
id: version | |
with: | |
cmd: "jq .version admin/version.json -r" | |
- run: | | |
docker login -u alexschimpf -p ${{ secrets.DOCKER_TOKEN }} && \ | |
docker build . -t alexschimpf/flagship-admin:latest -t alexschimpf/flagship-admin:${{ steps.version.outputs.value }} && \ | |
docker push alexschimpf/flagship-admin:${{ steps.version.outputs.value }} && \ | |
docker push alexschimpf/flagship-admin:latest | |
working-directory: ./admin | |
release: | |
needs: [deploy] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: sergeysova/jq-action@v2 | |
id: version | |
with: | |
cmd: "jq .version admin/version.json -r" | |
- run: | | |
git fetch origin main | |
echo "COMMIT_SHA=$(git rev-parse origin/main)" >> $GITHUB_ENV | |
git config --global user.email "[email protected]" | |
git config --global user.name "Alex Schimpf" | |
env: | |
GITHUB_TOKEN: ${{ secrets.CLI_PAT }} | |
- run: | | |
git tag -a admin/v${{ steps.version.outputs.value }} -m "Flagship Admin API v${{ steps.version.outputs.value }}" $COMMIT_SHA | |
git push origin admin/v${{ steps.version.outputs.value }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.CLI_PAT }} | |
- uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.CLI_PAT }} | |
with: | |
tag_name: admin/v${{ steps.version.outputs.value }} | |
release_name: "[Admin] Release v${{ steps.version.outputs.value }}" |