From 0c0ef17fb610ae683c4f22d1b5ecd8d7853037a2 Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Sat, 15 Feb 2025 07:02:55 +1300 Subject: [PATCH] chore: Initial Pipeline --- .github/build.yml | 26 ++++++++++++++++++++++++++ .github/release.yml | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/build.yml create mode 100644 .github/release.yml diff --git a/.github/build.yml b/.github/build.yml new file mode 100644 index 0000000..3b8c025 --- /dev/null +++ b/.github/build.yml @@ -0,0 +1,26 @@ +name: CI +on: + push: + branches: + - "**" + tags: + - "!**" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.22' + - name: Create release if required + uses: go-semantic-release/action@v1 + with: + custom-arguments: --provider=gitea + hooks: exec + env: + GITEA_TOKEN: ${{ secrets.G_TOKEN }} + GITEA_HOST: ${{ secrets.G_SERVER_URL}} + + diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..0189e91 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,38 @@ +name: CI +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Get Vars + run: | + echo ${GITHUB_REF_NAME} + echo ${GITHUB_REF_TYPE} + + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Container Registry + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: > + linux/amd64, + linux/arm64 + push: true + tags: > + ${{ secrets.DOCKERHUB_USERNAME }}/ara-api:latest, + ${{ secrets.DOCKERHUB_USERNAME }}/ara-api:${{ env.GITHUB_REF_NAME }} \ No newline at end of file