From 8c19c5beaff35f0619888667f562a85cb24bc783 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 09:31:18 +0200 Subject: [PATCH 01/12] hello workflow --- .github/workflows/myfirstworkflow.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/workflows/myfirstworkflow.yaml diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml new file mode 100644 index 0000000..077e168 --- /dev/null +++ b/.github/workflows/myfirstworkflow.yaml @@ -0,0 +1,8 @@ +name: First Workflow +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Run a sample script + run: echo "Hello, GitHub Actions!" \ No newline at end of file From fda8b9d68fe3c754d29c24af893749cb318308dd Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 09:45:33 +0200 Subject: [PATCH 02/12] welcome to the matrix --- .github/workflows/myfirstworkflow.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml index 077e168..98d8028 100644 --- a/.github/workflows/myfirstworkflow.yaml +++ b/.github/workflows/myfirstworkflow.yaml @@ -1,8 +1,16 @@ name: First Workflow on: push jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Run a sample script - run: echo "Hello, GitHub Actions!" \ No newline at end of file + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10, 12, 14] + steps: + - uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test \ No newline at end of file From 5f4f3337f5432cfe738e20c924efad7fb10dbb87 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 09:48:24 +0200 Subject: [PATCH 03/12] welcome to the matrix --- .github/workflows/myfirstworkflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml index 98d8028..5802fb2 100644 --- a/.github/workflows/myfirstworkflow.yaml +++ b/.github/workflows/myfirstworkflow.yaml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [10, 12, 14] + node-version: [16] steps: - uses: actions/checkout@v2 - name: Setup Node.js From a1fecdc95c436dd6fbd6e431e6ec90020a815187 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 09:50:33 +0200 Subject: [PATCH 04/12] welcome to the matrix --- .github/workflows/myfirstworkflow.yaml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml index 5802fb2..7282f65 100644 --- a/.github/workflows/myfirstworkflow.yaml +++ b/.github/workflows/myfirstworkflow.yaml @@ -1,16 +1,12 @@ -name: First Workflow +name: Deploy to Production on: push jobs: - test: + deploy: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16] steps: - - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm test \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v2 + - name: Deploy + run: ./deploy/deploy.sh + env: + API_TOKEN: ${{ secrets.API_TOKEN }} \ No newline at end of file From afab545a49d8838fae1ac91077c9acf790fd2241 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 09:52:04 +0200 Subject: [PATCH 05/12] welcome to the matrix --- .github/workflows/myfirstworkflow.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml index 7282f65..44e0a42 100644 --- a/.github/workflows/myfirstworkflow.yaml +++ b/.github/workflows/myfirstworkflow.yaml @@ -7,6 +7,8 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Deploy - run: ./deploy/deploy.sh + run: | + chmod +x /deploy/deploy.sh + ./deploy/deploy.sh env: API_TOKEN: ${{ secrets.API_TOKEN }} \ No newline at end of file From 9cbdb61ce5509deefc1af73a133b5cebbe2d6218 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 09:53:11 +0200 Subject: [PATCH 06/12] deployment stuff --- .github/workflows/myfirstworkflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml index 44e0a42..07ccad6 100644 --- a/.github/workflows/myfirstworkflow.yaml +++ b/.github/workflows/myfirstworkflow.yaml @@ -8,7 +8,7 @@ jobs: uses: actions/checkout@v2 - name: Deploy run: | - chmod +x /deploy/deploy.sh + chmod +x deploy/deploy.sh ./deploy/deploy.sh env: API_TOKEN: ${{ secrets.API_TOKEN }} \ No newline at end of file From e199c3e99f7c7dc74d1feb02ca79f624b35b4cf1 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 11:01:14 +0200 Subject: [PATCH 07/12] deployment stuff --- .github/workflows/myfirstworkflow.yaml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml index 07ccad6..c9561fd 100644 --- a/.github/workflows/myfirstworkflow.yaml +++ b/.github/workflows/myfirstworkflow.yaml @@ -1,14 +1,10 @@ name: Deploy to Production on: push jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Deploy - run: | - chmod +x deploy/deploy.sh - ./deploy/deploy.sh - env: - API_TOKEN: ${{ secrets.API_TOKEN }} \ No newline at end of file +- name: Cache dependencies + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- \ No newline at end of file From 52c234066781d440751caff2d7503c6c819e4f43 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 11:03:11 +0200 Subject: [PATCH 08/12] yaml ist super --- .github/workflows/myfirstworkflow.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml index c9561fd..0ac5285 100644 --- a/.github/workflows/myfirstworkflow.yaml +++ b/.github/workflows/myfirstworkflow.yaml @@ -1,10 +1,12 @@ name: Deploy to Production on: push -jobs: -- name: Cache dependencies - uses: actions/cache@v4 - with: - path: node_modules - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- \ No newline at end of file +deploy: + runs-on: ubuntu-latest + steps: + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- \ No newline at end of file From db173c6057f8e93db9cbee6aa03380542f126c68 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 11:05:07 +0200 Subject: [PATCH 09/12] yaml ist super --- .github/workflows/myfirstworkflow.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml index 0ac5285..aec3b7e 100644 --- a/.github/workflows/myfirstworkflow.yaml +++ b/.github/workflows/myfirstworkflow.yaml @@ -1,6 +1,7 @@ name: Deploy to Production on: push -deploy: +jobs: + deploy: runs-on: ubuntu-latest steps: - name: Cache dependencies From d721a47a2618d26ee8dc8cae22d5559ba10661f6 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 11:07:27 +0200 Subject: [PATCH 10/12] yaml ist super --- .github/workflows/myfirstworkflow.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml index aec3b7e..ccc5d72 100644 --- a/.github/workflows/myfirstworkflow.yaml +++ b/.github/workflows/myfirstworkflow.yaml @@ -10,4 +10,14 @@ jobs: path: node_modules key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ runner.os }}-node- \ No newline at end of file + ${{ runner.os }}-node- + - name: Create timestamp + id: create_timestamp + run: | + CURRENT_DATE=$(date +'%Y-%m-%d') + echo "current date $CURRENT_DATE" + echo "current_timestamp=$CURRENT_DATE" >> "$GITHUB_OUTPUT" + - name: Create image + run: echo "Create docker image with tag ${{ steps.create_timestamp.outputs.current_timestamp }}" + - name: Deploy tag + run: echo "Deploy tag ${{ steps.create_timestamp.outputs.current_timestamp }} to environment" \ No newline at end of file From 66ac6467f82e751f74281813e41bd4238acaba44 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 11:09:31 +0200 Subject: [PATCH 11/12] onissuecomment --- .github/workflows/myfirstworkflow.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml index ccc5d72..f9f1ba9 100644 --- a/.github/workflows/myfirstworkflow.yaml +++ b/.github/workflows/myfirstworkflow.yaml @@ -1,6 +1,9 @@ name: Deploy to Production -on: push +on: + issue_comment: jobs: + deploy: + if: contains(github.event.comment.body, '/deploy') deploy: runs-on: ubuntu-latest steps: From 8b0ecd67ea88ca41b5fc447731f65623a11e3882 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 12 Sep 2024 11:10:17 +0200 Subject: [PATCH 12/12] onissuecomment --- .github/workflows/myfirstworkflow.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/myfirstworkflow.yaml b/.github/workflows/myfirstworkflow.yaml index f9f1ba9..6af9715 100644 --- a/.github/workflows/myfirstworkflow.yaml +++ b/.github/workflows/myfirstworkflow.yaml @@ -4,7 +4,6 @@ on: jobs: deploy: if: contains(github.event.comment.body, '/deploy') - deploy: runs-on: ubuntu-latest steps: - name: Cache dependencies