Fix workflow: use env block instead of vars context
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:
DaX
2026-02-16 00:43:13 +01:00
parent 58c165749d
commit c837af6015

View File

@@ -4,6 +4,14 @@ on:
push: push:
branches: [main] 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: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -55,10 +63,6 @@ jobs:
- name: Build Next.js - name: Build Next.js
if: steps.changes.outputs.frontend == 'true' if: steps.changes.outputs.frontend == 'true'
run: npm run build 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 - name: Configure AWS credentials
if: steps.changes.outputs.frontend == 'true' || steps.changes.outputs.api == 'true' if: steps.changes.outputs.frontend == 'true' || steps.changes.outputs.api == 'true'
@@ -66,13 +70,11 @@ jobs:
with: with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }} aws-region: eu-central-1
- name: Deploy to S3 - name: Deploy to S3
if: steps.changes.outputs.frontend == 'true' if: steps.changes.outputs.frontend == 'true'
run: | run: |
S3_BUCKET="${{ vars.S3_BUCKET }}"
# Upload HTML files with no-cache # Upload HTML files with no-cache
aws s3 sync out/ s3://$S3_BUCKET/ \ aws s3 sync out/ s3://$S3_BUCKET/ \
--delete \ --delete \
@@ -103,8 +105,8 @@ jobs:
if: steps.changes.outputs.api == 'true' if: steps.changes.outputs.api == 'true'
run: | run: |
aws ssm send-command \ aws ssm send-command \
--region ${{ vars.AWS_REGION }} \ --region $AWS_REGION \
--instance-ids "${{ vars.INSTANCE_ID }}" \ --instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunShellScript" \ --document-name "AWS-RunShellScript" \
--parameters 'commands=[ --parameters 'commands=[
"cd /home/ubuntu/filamenteka-api", "cd /home/ubuntu/filamenteka-api",