diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..c027ccf --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,58 @@ +name: Ship It +on: + push: + branches: [main] + pull_request: + branches: [main] + +# Amali 5: permission untuk deploy GitHub Pages +permissions: + pages: write + id-token: write + contents: read + +concurrency: + group: pages + cancel-in-progress: true + +# The ship app lives in launchpad/ in the learner fork; run every step there. +defaults: + run: + working-directory: launchpad + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: 20 + cache: npm + cache-dependency-path: launchpad/package-lock.json + - run: npm clean-install + - run: npm run test # node scripts/preflight.mjs — a bad ship.config.json ABORTS here + + deploy: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: test # deploy only runs if the pre-flight gate is green + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deploy.outputs.page_url }} + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: 20 + cache: npm + cache-dependency-path: launchpad/package-lock.json + - run: npm clean-install + - run: npm run build + env: + VITE_CALLSIGN: ${{ github.actor }} + - uses: actions/upload-pages-artifact@v5 + with: + path: launchpad/dist + - id: deploy + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ea44f08 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,18 @@ +name: Generate Report + +on: + workflow_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Run report + run: bash scripts/report.sh + env: + BOARD_URL: ${{ vars.BOARD_URL }} + SHIPIT_TOKEN: ${{ secrets.SHIPIT_TOKEN }} diff --git a/launchpad/ship.config.json b/launchpad/ship.config.json index 0221b94..34b4809 100644 --- a/launchpad/ship.config.json +++ b/launchpad/ship.config.json @@ -1,6 +1,6 @@ { "shipName": "Nebula Runner", - "color": "22d3ee", + "color": "#22d3ee", "shipModel": "fighter", "emblem": "comet" }