diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 42a6bf4..5fddfcd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,10 @@ on: branches: [main] workflow_dispatch: +permissions: + id-token: write + contents: read + jobs: deploy: runs-on: ubuntu-latest @@ -13,24 +17,16 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Deploy to server - uses: appleboy/scp-action@v0.1.7 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 with: - host: ${{ secrets.SERVER_HOST }} - username: ${{ secrets.SERVER_USER }} - key: ${{ secrets.SERVER_SSH_KEY }} - port: ${{ secrets.SERVER_PORT }} - source: "index.html,css/,js/,assets/" - target: "/var/www/webos" - strip_components: 0 + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + aws-region: us-east-1 - - name: Set permissions - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.SERVER_HOST }} - username: ${{ secrets.SERVER_USER }} - key: ${{ secrets.SERVER_SSH_KEY }} - port: ${{ secrets.SERVER_PORT }} - script: | - sudo chown -R www-data:www-data /var/www/webos - sudo chmod -R 755 /var/www/webos + - name: Deploy to S3 + run: | + aws s3 sync . s3://webos.gregh.dev/ \ + --exclude ".git/*" \ + --exclude ".github/*" \ + --exclude "README.md" \ + --delete