From d15e011bb2cc1ff4a098ca78ae5bf24a16b06cb8 Mon Sep 17 00:00:00 2001 From: Andrew Ho <87453706+anmho@users.noreply.github.com> Date: Sun, 24 Nov 2024 15:35:14 -0800 Subject: [PATCH 1/7] add quickstart workflow --- .github/workflows/ci.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..e5bb1615 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,18 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file From 2c864b173e9b33fda02d9ebf2381e12a47a34fa7 Mon Sep 17 00:00:00 2001 From: Andrew Ho <87453706+anmho@users.noreply.github.com> Date: Sun, 24 Nov 2024 15:57:28 -0800 Subject: [PATCH 2/7] build job --- .github/workflows/{ci.yaml => ci.yml} | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) rename .github/workflows/{ci.yaml => ci.yml} (74%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yml similarity index 74% rename from .github/workflows/ci.yaml rename to .github/workflows/ci.yml index e5bb1615..d0b40028 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ name: GitHub Actions Demo run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 -on: [push] +on: + push: + paths: + - api jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest @@ -15,4 +18,25 @@ jobs: - name: List files in the repository run: | ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file + - run: echo "🍏 This job's status is ${{ job.status }}." + build: + runs-on: ubuntu-latest + steps: + - run: make test + - run: make image + - run: make push + + +# terraform: +# runs-on: ubuntu-latest +# steps: +# - run: make + + + + # terraform credentials setup + + # build + # personal deployment + + From 91ca3ca1ae2a0dc97ecc67529e68b7fa8e29a2b5 Mon Sep 17 00:00:00 2001 From: Andrew Ho <87453706+anmho@users.noreply.github.com> Date: Sun, 24 Nov 2024 15:57:56 -0800 Subject: [PATCH 3/7] all pushes --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0b40028..ba7f4c93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,6 @@ name: GitHub Actions Demo run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 -on: - push: - paths: - - api +on: [push] jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest From 3ca8e22155f44d3bf90eb23f2f72291357324c79 Mon Sep 17 00:00:00 2001 From: Andrew Ho <87453706+anmho@users.noreply.github.com> Date: Sun, 24 Nov 2024 16:01:17 -0800 Subject: [PATCH 4/7] build workflow --- .github/workflows/ci.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba7f4c93..df192b08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,9 +19,22 @@ jobs: build: runs-on: ubuntu-latest steps: - - run: make test - - run: make image - - run: make push + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.22.2' + + - name: Test + run: make test + + - name: Build docker image + run: make image + + - name: Push docker image + run: make push # terraform: From 1233214dfc2eb4324edd75a1f79316bfd6278564 Mon Sep 17 00:00:00 2001 From: Andrew Ho <87453706+anmho@users.noreply.github.com> Date: Sun, 24 Nov 2024 16:04:36 -0800 Subject: [PATCH 5/7] workdir --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df192b08..cb7364cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: - run: echo "🍏 This job's status is ${{ job.status }}." build: runs-on: ubuntu-latest + steps: - name: Checkout code uses: actions/checkout@v4 @@ -29,12 +30,15 @@ jobs: - name: Test run: make test + working-directory: ./api - name: Build docker image run: make image + working-directory: ./api - name: Push docker image run: make push + working-directory: ./api # terraform: From 97c86bdcdb2b9b3ef851496a02c8397e942dbfc8 Mon Sep 17 00:00:00 2001 From: Andrew Ho <87453706+anmho@users.noreply.github.com> Date: Sun, 24 Nov 2024 16:27:09 -0800 Subject: [PATCH 6/7] add docker login --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb7364cf..80632f73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,11 @@ jobs: run: make test working-directory: ./api + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build docker image run: make image working-directory: ./api From a21269c6b736bd0863cbf9c682687607a869a8a0 Mon Sep 17 00:00:00 2001 From: Andrew Ho <87453706+anmho@users.noreply.github.com> Date: Sun, 24 Nov 2024 16:48:46 -0800 Subject: [PATCH 7/7] clean up ci.yml --- .github/workflows/ci.yml | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80632f73..4f1fbd52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,23 +2,8 @@ name: GitHub Actions Demo run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 on: [push] jobs: - Explore-GitHub-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." build: runs-on: ubuntu-latest - steps: - name: Checkout code uses: actions/checkout@v4 @@ -37,25 +22,11 @@ jobs: with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build docker image run: make image working-directory: ./api - name: Push docker image run: make push - working-directory: ./api - - -# terraform: -# runs-on: ubuntu-latest -# steps: -# - run: make - - - - # terraform credentials setup - - # build - # personal deployment - - + working-directory: ./api \ No newline at end of file