diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..ac3b548 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,51 @@ +name: Build +on: + push: + branches: + - main + pull_request: {} + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 7 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Cache dist folder + id: cache-dist + uses: actions/cache@v3 + env: + cache-name: cache-dist + with: + path: dist + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('pnpm-lock.yaml') }} + + - name: Run build + if: steps.cache-dist.outputs.cache-hit != 'true' + run: pnpm build + + + - name: Upload dist artifact + uses: actions/upload-artifact@v2 + if: always() + with: + name: dist + path: dist \ No newline at end of file diff --git a/.github/workflows/workshop.yaml b/.github/workflows/workshop.yaml new file mode 100644 index 0000000..2c6fecf --- /dev/null +++ b/.github/workflows/workshop.yaml @@ -0,0 +1,41 @@ +name: Workshop +on: + push: + branches: + - main + pull_request: {} + +env: + GREETING: Hello + +jobs: + print-greeting: + name: Print greeting + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Print + run: echo $GREETING + + save-greeting: + name: Save greeting + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Save to file + run: echo $GREETING > greeting.txt + + - name: Store artifact + uses: actions/upload-artifact@v2 + if: always() + with: + name: greetingfile + path: greeting.txt \ No newline at end of file