Skip to content

Commit

Permalink
Test against the image
Browse files Browse the repository at this point in the history
  • Loading branch information
hidakatsuya committed Apr 27, 2024
1 parent d1c7617 commit e4eccc9
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 45 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test
description: Test the image

inputs:
test-tag:
required: true

env:
RAILS_ENV: development

runs:
using: composite

steps:
- uses: actions/checkout@v4
with:
repository: redmine/redmine
ref: master
path: redmine

- run: |
docker volume create redmine-bundle-cache
cd redmine
cat <<EOS > config/database.yml
development:
adapter: sqlite3
database: db/development.sqlite3
EOS
docker run --rm -v ${PWD}:/redmine \
-v redmine-bundle-cache:/bundle \
-p 3000:3000 \
${{ inputs.test-tag }} \
bash -c "bundle install && bin/about"
54 changes: 54 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build

on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'redmined'
workflow_dispatch:

env:
TEST_TAG: redmined:test
IMAGE_TAG: ghcr.io/hidakatsuya/redmined:latest

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and export to Docker for testing
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}

- name: Test
uses: ./.github/actions/test

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.IMAGE_TAG }}

45 changes: 0 additions & 45 deletions .github/workflows/docker-publish.yml

This file was deleted.

0 comments on commit e4eccc9

Please sign in to comment.