From ca6ff5bb69bbdd96184c96d24a75e1a8aafa1994 Mon Sep 17 00:00:00 2001 From: Michael Wiesing Date: Wed, 16 Nov 2022 15:19:51 +0100 Subject: [PATCH 1/5] Step 1 --- .github/workflows/test-on-pullrequest.yml | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/test-on-pullrequest.yml diff --git a/.github/workflows/test-on-pullrequest.yml b/.github/workflows/test-on-pullrequest.yml new file mode 100644 index 0000000..3b12e81 --- /dev/null +++ b/.github/workflows/test-on-pullrequest.yml @@ -0,0 +1,35 @@ +name: Run Angular tests + +on: + pull_request_target: + types: [opened, synchronize, reopened] + +jobs: + docs: + name: 'Run Angular tests' + runs-on: ubuntu-latest + + steps: + + - name: '☁️ Checkout repository' + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: '⚙️ Use Node.js' + uses: actions/setup-node@v3 + with: + check-latest: true + cache: 'npm' + + - name: '⚙️ Use Node.js' + uses: actions/setup-node@v3 + with: + check-latest: true + cache: 'npm' + + - name: '⛓️ Install dependencies' + run: npm ci --no-optional --no-audit --prefer-offline --progress=false + + - name: 'Test' + run: npm test \ No newline at end of file From b07ba0e869cc155383e25d1801150e20719ed2b9 Mon Sep 17 00:00:00 2001 From: Michael Wiesing Date: Wed, 16 Nov 2022 15:22:38 +0100 Subject: [PATCH 2/5] Step 2 --- src/app/app.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 698fdbb..4c6946f 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -341,7 +341,7 @@ - {{ title }} app is running! + {{ title }} Hello World! Rocket Ship Smoke From 10208ab33e85a81ffaa9259feb7061b728ed394b Mon Sep 17 00:00:00 2001 From: Michael Wiesing Date: Wed, 16 Nov 2022 15:30:09 +0100 Subject: [PATCH 3/5] Step 3 --- src/app/app.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index aa0484b..3b81398 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -26,6 +26,6 @@ describe('AppComponent', () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('.content span')?.textContent).toContain('github-actions-tutorial app is running!'); + expect(compiled.querySelector('.content span')?.textContent).toContain('github-actions-tutorial Hello World!'); }); }); From 3f48525e8290b584417d5df89464ed8cf91b2dbc Mon Sep 17 00:00:00 2001 From: Michael Wiesing Date: Wed, 30 Nov 2022 15:21:14 +0100 Subject: [PATCH 4/5] Github pages 1 --- .github/workflows/deploy-on-push-to-main.yml | 47 ++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/deploy-on-push-to-main.yml diff --git a/.github/workflows/deploy-on-push-to-main.yml b/.github/workflows/deploy-on-push-to-main.yml new file mode 100644 index 0000000..51726c1 --- /dev/null +++ b/.github/workflows/deploy-on-push-to-main.yml @@ -0,0 +1,47 @@ +name: Deploy + +on: + push: + branches: + - 'main' + +permissions: + id-token: write + pages: write + deployments: write + +jobs: + docs: + name: '🌍 Deploy' + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: '☁️ Checkout repository' + uses: actions/checkout@v3 + + - name: '⚙️ Use Node.js' + uses: actions/setup-node@v3 + with: + check-latest: true + cache: 'npm' + + - name: '⛓️ Install dependencies' + run: npm ci --no-optional --no-audit --prefer-offline --progress=false + - name: '🛠️ Build' + run: npm run build --prod + + - name: Setup Pages + uses: actions/configure-pages@v2 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + # dist directory of the application + path: './dist/github-actions-tutorial/' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 \ No newline at end of file From 87174c123d4b73de120aa048f1a85795358e9235 Mon Sep 17 00:00:00 2001 From: Michael Wiesing Date: Wed, 30 Nov 2022 15:30:02 +0100 Subject: [PATCH 5/5] Github pages 2 --- .github/workflows/deploy-on-push-to-main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-on-push-to-main.yml b/.github/workflows/deploy-on-push-to-main.yml index 51726c1..1152443 100644 --- a/.github/workflows/deploy-on-push-to-main.yml +++ b/.github/workflows/deploy-on-push-to-main.yml @@ -29,7 +29,7 @@ jobs: cache: 'npm' - name: '⛓️ Install dependencies' - run: npm ci --no-optional --no-audit --prefer-offline --progress=false + run: npm ci --no-optional --no-audit --prefer-offline --progress=false - name: '🛠️ Build' run: npm run build --prod