Giacomo Leidi ba3eef4341
Docker image (#84)
* Add [guix](https://guix.gnu.org/) package.

This enables:

- [direnv](https://direnv.net/) integration to setup and tear down
  a suitable development environment;
- if you're not a direnv user you can always
  `guix environment -l guix.scm` to spawn a shell
  with all the necessary dependencies;
- Export of Mobilizon Reshare and its dependencies
  to one of the formats supported by `guix pack`. Right now they are:

    + tarball       Self-contained tarball, ready to run on another machine
    + squashfs      Squashfs image suitable for Singularity
    + docker        Docker image ready for 'docker load'
    + deb           Debian archive installable via dpkg/apt

* Add docker image and docker-compose.yml.

* Add Github CI workflow.
2021-10-31 01:55:25 +02:00

68 lines
2.1 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- v*
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Install GNU Guix
uses: PromyLOPh/guix-install-action@v1
# Runs a set of commands using the runners shell
- name: Build image
run: scripts/build_docker_image.sh
- name: Upload pack (Docker)
uses: actions/upload-artifact@v2
with:
name: mobilizon-reshare-docker
path: docker-image.tar.gz
publish:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: build
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Get release tag
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Download image
uses: actions/download-artifact@v2
with:
name: mobilizon-reshare-docker
- name: Publish to Docker Hub
uses: fishinthecalculator/publish-docker-image-action@v0.1.3
env:
IMAGE_TAG: ${{ steps.vars.outputs.tag }}
with:
name: fishinthecalculator/mobilizon-reshare
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
image: docker-image.tar.gz