From b12353ffc9825a069c155c8d26846bd38783caa4 Mon Sep 17 00:00:00 2001 From: Prariya Date: Wed, 23 Nov 2022 20:13:48 +0700 Subject: [PATCH 1/3] add yml --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..79a1a4c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +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 + - 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 From 38baeacb3ced1458c142747cd8c1cb455691a817 Mon Sep 17 00:00:00 2001 From: Prariya Date: Wed, 23 Nov 2022 20:20:11 +0700 Subject: [PATCH 2/3] fix yml --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c3aece9 --- /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 From 4a63edd98fd3950527d16613e9bf73f9f49c7bd1 Mon Sep 17 00:00:00 2001 From: Prariya Date: Wed, 23 Nov 2022 20:22:27 +0700 Subject: [PATCH 3/3] fix yml --- .github/workflows/ci.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3aece9..c1b50d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,18 +6,18 @@ 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 + - 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 @@ -27,13 +27,13 @@ jobs: 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 + - 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