From ff47e57837ff55c5c0ba910e90f4e7ae366af3eb Mon Sep 17 00:00:00 2001 From: fxi Date: Thu, 7 Dec 2023 14:08:07 +0100 Subject: [PATCH] ci : gh action test --- .github/workflows/build.yml | 42 +++++++++++++++++++++++++++++++++++++ .gitignore | 5 +++++ README.md | 3 +++ build.sh | 1 - 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..7d2a9e80 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: ci + +on: + push: + branches: + - "ci" +env: + REPO_NAME: 'fredmoser' + APP_NAME: 'accessmod' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Get version + id: get_version + #run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV + run: echo "VERSION=ci" >> $GITHUB_ENV + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ env.REPO_NAME }}/${{ env.APP_NAME }}:${{ env.VERSION }} diff --git a/.gitignore b/.gitignore index 9c533679..555765ae 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,11 @@ Session.vim # .language +# +# Secrets : actions, etc.. +# +.secrets + # # Docker exported image # - For electron launcher offline init. diff --git a/README.md b/README.md index 08cd47cc..28872799 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,9 @@ $ docker compose exec am5_dev R cd docker ./build.sh +# ---------- Github actions testing (not fully implemented) +act --secret-file .secrets --remote-name github --container-architecture linux/amd64 + # ---------- BASIC END-TO-END TESTS # Default script diff --git a/build.sh b/build.sh index 72040dde..4cb2da45 100755 --- a/build.sh +++ b/build.sh @@ -30,7 +30,6 @@ set -e REMOTE="github" IMAGENAME="fredmoser/accessmod" CUR_DIR=$(pwd) -FILE_TESTS="/tmp/tests.log" NEW_VERSION=$1 OLD_VERSION=$(