Fix workflow: use env block instead of vars context
Some checks failed
Deploy / deploy (push) Failing after 5m59s
Some checks failed
Deploy / deploy (push) Failing after 5m59s
Gitea act runner doesn't resolve vars context properly. Move all non-sensitive config to workflow-level env block.
This commit is contained in:
@@ -4,6 +4,14 @@ on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
AWS_REGION: eu-central-1
|
||||
S3_BUCKET: filamenteka-frontend
|
||||
INSTANCE_ID: i-03956ecf32292d7d9
|
||||
NEXT_PUBLIC_API_URL: https://api.filamenteka.rs/api
|
||||
NEXT_PUBLIC_MATOMO_URL: https://analytics.demirix.dev
|
||||
NEXT_PUBLIC_MATOMO_SITE_ID: "7"
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -55,10 +63,6 @@ jobs:
|
||||
- name: Build Next.js
|
||||
if: steps.changes.outputs.frontend == 'true'
|
||||
run: npm run build
|
||||
env:
|
||||
NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }}
|
||||
NEXT_PUBLIC_MATOMO_URL: ${{ vars.NEXT_PUBLIC_MATOMO_URL }}
|
||||
NEXT_PUBLIC_MATOMO_SITE_ID: ${{ vars.NEXT_PUBLIC_MATOMO_SITE_ID }}
|
||||
|
||||
- name: Configure AWS credentials
|
||||
if: steps.changes.outputs.frontend == 'true' || steps.changes.outputs.api == 'true'
|
||||
@@ -66,13 +70,11 @@ jobs:
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: ${{ vars.AWS_REGION }}
|
||||
aws-region: eu-central-1
|
||||
|
||||
- name: Deploy to S3
|
||||
if: steps.changes.outputs.frontend == 'true'
|
||||
run: |
|
||||
S3_BUCKET="${{ vars.S3_BUCKET }}"
|
||||
|
||||
# Upload HTML files with no-cache
|
||||
aws s3 sync out/ s3://$S3_BUCKET/ \
|
||||
--delete \
|
||||
@@ -103,8 +105,8 @@ jobs:
|
||||
if: steps.changes.outputs.api == 'true'
|
||||
run: |
|
||||
aws ssm send-command \
|
||||
--region ${{ vars.AWS_REGION }} \
|
||||
--instance-ids "${{ vars.INSTANCE_ID }}" \
|
||||
--region $AWS_REGION \
|
||||
--instance-ids "$INSTANCE_ID" \
|
||||
--document-name "AWS-RunShellScript" \
|
||||
--parameters 'commands=[
|
||||
"cd /home/ubuntu/filamenteka-api",
|
||||
|
||||
Reference in New Issue
Block a user