Skip to content

github: Publish docker image to Docker Hub #4

github: Publish docker image to Docker Hub

github: Publish docker image to Docker Hub #4

Workflow file for this run

# Copyright © 2016-2024 Endless OS Foundation LLC
# SPDX-License-Identifier: GPL-2.0-or-later
name: EOS Activation Server Tests
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
env:
IMAGE: endlessm/eos-activation-server
TEST_TAG: ${{ env.IMAGE }}:test

Check failure on line 14 in .github/workflows/tests.yml

View workflow run for this annotation

GitHub Actions / EOS Activation Server Tests

Invalid workflow file

The workflow is not valid. .github/workflows/tests.yml (Line: 14, Col: 13): Unrecognized named-value: 'env'. Located at position 1 within expression: env.IMAGE .github/workflows/tests.yml (Line: 15, Col: 15): Unrecognized named-value: 'env'. Located at position 1 within expression: env.IMAGE
LATEST_TAG: ${{ env.IMAGE }}:latest
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
pull: true
tags: ${{ env.TEST_TAG }}
- name: Run Redis
run: docker run -d --rm --network=host --name=redis redis:5-alpine
- name: Run server
run: docker run -d --rm --network=host --name=server ${{ env.TEST_TAG }}
- name: Run tests
run: docker run --rm --network=host ${{ env.TEST_TAG }} npm test
- name: Stop server
run: docker stop server
- name: Stop Redis
run: docker stop redis
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
labels: ${{ steps.meta.outputs.labels }}
push: ${{ github.ref == 'refs/heads/master' }}
tags: ${{ env.LATEST_TAG }}