mirror of
https://github.com/ghndrx/webos.git
synced 2026-02-10 06:45:00 +00:00
Switch to S3 deployment
This commit is contained in:
34
.github/workflows/deploy.yml
vendored
34
.github/workflows/deploy.yml
vendored
@@ -5,6 +5,10 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -13,24 +17,16 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Deploy to server
|
- name: Configure AWS credentials
|
||||||
uses: appleboy/scp-action@v0.1.7
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.SERVER_HOST }}
|
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
|
||||||
username: ${{ secrets.SERVER_USER }}
|
aws-region: us-east-1
|
||||||
key: ${{ secrets.SERVER_SSH_KEY }}
|
|
||||||
port: ${{ secrets.SERVER_PORT }}
|
|
||||||
source: "index.html,css/,js/,assets/"
|
|
||||||
target: "/var/www/webos"
|
|
||||||
strip_components: 0
|
|
||||||
|
|
||||||
- name: Set permissions
|
- name: Deploy to S3
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
run: |
|
||||||
with:
|
aws s3 sync . s3://webos.gregh.dev/ \
|
||||||
host: ${{ secrets.SERVER_HOST }}
|
--exclude ".git/*" \
|
||||||
username: ${{ secrets.SERVER_USER }}
|
--exclude ".github/*" \
|
||||||
key: ${{ secrets.SERVER_SSH_KEY }}
|
--exclude "README.md" \
|
||||||
port: ${{ secrets.SERVER_PORT }}
|
--delete
|
||||||
script: |
|
|
||||||
sudo chown -R www-data:www-data /var/www/webos
|
|
||||||
sudo chmod -R 755 /var/www/webos
|
|
||||||
|
|||||||
Reference in New Issue
Block a user