Version 3.26.2 #2334
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: Build & deploy to production | |
on: | |
release: | |
types: [ published ] | |
jobs: | |
build_assets: | |
name: Build assets | |
runs-on: ubuntu-latest | |
env: | |
CYPRESS_INSTALL_BINARY: '0' | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.3 | |
tools: composer:v2 | |
extensions: redis | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: composer install --prefer-dist --no-progress --no-scripts | |
- run: npm ci | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install python-swiftclient python-keystoneclient | |
pip install awscli==1.36 | |
- name: Compile SDK for production | |
run: NODE_ENV=production npm run sdk:build | |
- name: Compile assets for production | |
run: | | |
NODE_ENV=production node_modules/.bin/encore production | |
cp web/js/coopcycle.js web/build | |
- name: Upload assets to storage | |
run: | | |
mkdir $GITHUB_SHA | |
tar czvf $GITHUB_SHA/assets.tgz -C web/build . | |
aws --endpoint=$AWS_ENDPOINT s3 cp $GITHUB_SHA/assets.tgz s3://sha1/$GITHUB_SHA.tgz --acl public-read | |
env: | |
AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
deploy: | |
name: Deploy to production | |
runs-on: ubuntu-latest | |
needs: build_assets | |
steps: | |
- name: Send repository dispatch event | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.REPO_DISPATCH_TOKEN }} | |
repository: coopcycle/coopcycle-ops | |
event-type: coopcycle-release | |
client-payload: '{"tag": "${{ github.event.release.tag_name }}"}' |