Skip to content

update actions

update actions #14

Workflow file for this run

name: 'latest'
on:
push:
branches: [ 'main' ]
jobs:
deploy-bmlt-portal-latest:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
id: code-checkout
- name: Validate composer.json and composer.lock
id: composer-validate
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
id: install-dependencies
run: composer install --no-dev --prefer-dist --no-progress --no-suggest --classmap-authoritative
- name: Prepare zip file
run: |
export ARTIFACT_FILE=bmlt-portal
export ARTIFACT_FILENAME=bmlt-portal.zip
echo "ARTIFACT_FILENAME=${ARTIFACT_FILENAME}" >> $GITHUB_ENV
git archive --format=zip --output=${ARTIFACT_FILENAME} --prefix=${ARTIFACT_FILE}/ ${GITHUB_SHA}
unzip ${ARTIFACT_FILENAME}
rm ${ARTIFACT_FILENAME}
echo ${GITHUB_SHA} > ${ARTIFACT_FILE}/build.txt
cp -R vendor ${ARTIFACT_FILE}/
zip -r -9 ${ARTIFACT_FILENAME} ${ARTIFACT_FILE}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions/gh-ci-s3-artifact
role-session-name: gh-actions-bmlt-portal
aws-region: us-east-1
- name: copy artifact to s3
run: |
aws s3 cp ${ARTIFACT_FILENAME} s3://${{ secrets.S3_BUCKET }}/bmlt-portal/bmlt-portal-build${GITHUB_RUN_NUMBER}-${GITHUB_SHA}