diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c1b50d4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +on: + pull_request: + branches: [main] + +jobs: + Build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + -- name: Build and push + uses: docker/build-push-action@v3 + with: + push: true + tags: | + encx/agoda-ci-workshop-2022:1.0.${{ github.run_id }}-alpha + Test: + runs-on: ubuntu-latest + needs: build + services: + our_website: + image: encx/agoda-ci-workshop-2022:1.0.${{ github.run_id }}-alpha + ports: + - 3000:3000 + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 16 + uses: actions/setup-node@v3 + with: + node-version: 16.x + - run: yarn + - run: npx playwright install chromium + - run: yarn test:e2e + + \ No newline at end of file