v1.4.12 #69
Workflow file for this run
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: Deploy | |
on: | |
release: | |
types: [created] | |
jobs: | |
release: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Build | |
run: | | |
make build-prod | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Tag Docker image | |
run: | | |
TAG_NAME=$(grep -oP '(?<=# \[)[^\]]+' CHANGELOG.md | head -n 1) | |
echo "Tagging with $TAG_NAME" | |
VERSION=v$TAG_NAME | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
docker tag napse_dtk_prod_django ghcr.io/${{ github.repository }}/napse_dtk_prod_django:$VERSION | |
docker tag napse_dtk_prod_django ghcr.io/${{ github.repository }}/napse_dtk_prod_django:latest | |
- name: Push Django Docker image | |
env: | |
VERSION: ${{ env.VERSION }} | |
run: | | |
docker push ghcr.io/${{ github.repository }}/napse_dtk_prod_django:${{ env.VERSION }} | |
- name: Push Django Docker image latest | |
run: | | |
docker push ghcr.io/${{ github.repository }}/napse_dtk_prod_django:latest | |
- name: Create .zip file | |
env: | |
VERSION: ${{ env.VERSION }} | |
NAPSE_SECRET_DEPLOYMENT_TOKEN_AWS: ${{ secrets.NAPSE_SECRET_DEPLOYMENT_TOKEN_AWS }} | |
NAPSE_DEPLOY_USERNAME: ${{ secrets.NAPSE_DEPLOY_USERNAME }} | |
NAPSE_VERSION: ${{ env.VERSION }} | |
run: | | |
make setup-prod | |
cd provisionEB | |
zip -r deploy-$VERSION.zip docker-compose.yml Dockerrun.aws.json .envs .ebextensions .platform | |
zip deploy-aws-$VERSION.zip deploy-$VERSION.zip config.json | |
mv deploy-aws-$VERSION.zip ../deploy-aws-$VERSION.zip | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VERSION: ${{ env.VERSION }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: deploy-aws-${{ env.VERSION }}.zip | |
asset_name: deploy-aws-${{ env.VERSION }}.zip | |
asset_content_type: application/zip |