Skip to content

Commit

Permalink
ci : gh action test
Browse files Browse the repository at this point in the history
  • Loading branch information
fxi committed Dec 7, 2023
1 parent 37fd17c commit ff47e57
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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 }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ Session.vim
#
.language

#
# Secrets : actions, etc..
#
.secrets

#
# Docker exported image
# - For electron launcher offline init.
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ set -e
REMOTE="github"
IMAGENAME="fredmoser/accessmod"
CUR_DIR=$(pwd)
FILE_TESTS="/tmp/tests.log"
NEW_VERSION=$1
OLD_VERSION=$(<version.txt)
DRY_RUN=false
Expand Down

0 comments on commit ff47e57

Please sign in to comment.