Deploy Process #524
This file contains hidden or 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 Process | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| schedule: | |
| - cron: '0 4 * * *' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: Firenza/secrets-to-env@v1.2.0 | |
| with: | |
| secrets: ${{ toJSON(secrets) }} | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y zip | |
| - name : Fetch Richmond Sunlight includes | |
| run: | | |
| git clone -b deploy https://github.com/openva/richmondsunlight.com.git | |
| cd richmondsunlight.com && composer install --no-interaction --no-progress --prefer-dist && cd .. | |
| mkdir includes/ | |
| cp richmondsunlight.com/htdocs/includes/*.php includes/ | |
| rm -Rf richmondsunlight.com | |
| - name: Build Docker environment | |
| run: ./docker-run.sh | |
| - name: Run test suite inside Docker | |
| run: ./docker-tests.sh | |
| - name: Stop Docker environment | |
| run: ./docker-stop.sh | |
| - name: Make sure there are no fatal errors in PHP | |
| run: find *.php -print0 |xargs -0 -n1 -P8 php -l | |
| - name: Build artifact | |
| run: | | |
| ./deploy/config_variables.sh | |
| ./deploy/aws_credentials.sh | |
| mkdir -p upload | |
| zip -qr upload/latest.zip . -x '*.git*' '*.scannerwork*' 'upload/*' | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: codebase | |
| path: . | |
| deploy: | |
| name: Deploy | |
| runs-on: ubuntu-24.04 | |
| needs: build | |
| if: github.event_name != 'pull_request' | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: codebase | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | |
| aws-region: us-east-1 | |
| - name: Copy file to S3 | |
| run: aws s3 cp upload/latest.zip s3://deploy.richmondsunlight.com/rs-video-processor-master.zip |