This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
Merge pull request #30 from phpvms/dev #54
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: CI | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
env: | |
RELEASE_TYPE: release | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Cleanup build folder' | |
run: | | |
ls -la ./ | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
ls -la ./ | |
- uses: actions/checkout@v3 | |
- name: Set the release folder | |
run: | | |
if [[ "${{github.base_ref}}" == "dev" || "${{github.ref}}" == "refs/heads/dev" ]]; then | |
echo "RELEASE_TYPE=beta" >> $GITHUB_ENV | |
fi | |
- name: Set AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-2 | |
- name: Create tar and upload | |
run: | | |
mkdir -p /tmp | |
tar -czf /tmp/config.tar.gz --exclude-vcs --exclude='./.github' . | |
mkdir -p artifacts | |
mv /tmp/config.tar.gz artifacts/ | |
cd artifacts | |
aws s3 sync --acl public-read . s3://${{ secrets.AWS_S3_BUCKET }}/$RELEASE_TYPE |