Skip to content

Commit

Permalink
Merge pull request #71 from AikidoSec/remove-s3-deploy
Browse files Browse the repository at this point in the history
Remove S3 deployment (will use Github releases from now on)
  • Loading branch information
willem-delbare authored Nov 1, 2024
2 parents 738cf1c + 680a27f commit 80aa3b7
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
uses: ./.github/workflows/build.yml
release:
runs-on: S3-deployer
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
Expand All @@ -18,16 +18,6 @@ jobs:
run: |
echo "AIKIDO_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Set env
run: |
echo "AIKIDO_S3=s3://aikido-firewall" >> $GITHUB_ENV
echo "AIKIDO_S3_BUCKET=v${{ env.AIKIDO_VERSION }}/linux_x86_64" >> $GITHUB_ENV
echo "AIKIDO_RPM=aikido-php-firewall-${{ env.AIKIDO_VERSION }}-1.x86_64.rpm" >> $GITHUB_ENV
echo "AIKIDO_DEB=aikido-php-firewall-${{ env.AIKIDO_VERSION }}-1.x86_64.deb" >> $GITHUB_ENV
echo "AIKIDO_RPM_LATEST=aikido-php-firewall.x86_64.rpm" >> $GITHUB_ENV
echo "AIKIDO_DEB_LATEST=aikido-php-firewall.x86_64.deb" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4

Expand All @@ -41,29 +31,7 @@ jobs:
run: |
ls -l
pwd
- name: Setup AWS CLI Production
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.S3_AWS_ACCESS_KEY_ID_PROD }}
aws-secret-access-key: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY_PROD }}
aws-region: eu-west-1

- name: Sync packages to S3 bucket
run: |
ls -l
aws s3 cp ${{ env.AIKIDO_RPM }}/${{ env.AIKIDO_RPM }} ${{ env.AIKIDO_S3 }}/${{ env.AIKIDO_S3_BUCKET }}/${{ env.AIKIDO_RPM }}
aws s3 cp ${{ env.AIKIDO_DEB }}/${{ env.AIKIDO_DEB }} ${{ env.AIKIDO_S3 }}/${{ env.AIKIDO_S3_BUCKET }}/${{ env.AIKIDO_DEB }}
aws s3 cp ${{ env.AIKIDO_RPM }}/${{ env.AIKIDO_RPM }} ${{ env.AIKIDO_S3 }}/${{ env.AIKIDO_RPM_LATEST }}
aws s3 cp ${{ env.AIKIDO_DEB }}/${{ env.AIKIDO_DEB }} ${{ env.AIKIDO_S3 }}/${{ env.AIKIDO_DEB_LATEST }}
- name: Make S3 bucket publicly readable
run: |
aws s3api put-object-acl --acl public-read --bucket aikido-firewall --key ${{ env.AIKIDO_S3_BUCKET }}/${{ env.AIKIDO_RPM }}
aws s3api put-object-acl --acl public-read --bucket aikido-firewall --key ${{ env.AIKIDO_S3_BUCKET }}/${{ env.AIKIDO_DEB }}
aws s3api put-object-acl --acl public-read --bucket aikido-firewall --key ${{ env.AIKIDO_RPM_LATEST }}
aws s3api put-object-acl --acl public-read --bucket aikido-firewall --key ${{ env.AIKIDO_DEB_LATEST }}
- name: Deploy to GitHub Release
uses: softprops/action-gh-release@v2
with:
Expand Down

0 comments on commit 80aa3b7

Please sign in to comment.