Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to ghcr.io #98

Merged
merged 2 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Build and test the images
- name: Run build-and-test.sh
Expand Down
23 changes: 11 additions & 12 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
#!/bin/bash
# Copyright (C) 2016 Intel Corporation
# Copyright (C) 2024 Konsulko Group
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# SPDX-License-Identifier: GPL-2.0-only
#
# This script is meant to be consumed by travis. It's very simple but running
# a loop in travis.yml isn't a great thing.
Expand All @@ -33,6 +23,15 @@ if ([ "${GITHUB_EVENT_NAME}" = "push" ] || [ "${GITHUB_EVENT_NAME}" = "workflow_
${ENGINE_CMD} tag ${REPO}:${BASE_DISTRO} ${REPO}:latest
${ENGINE_CMD} push ${REPO}:latest
fi

echo $GHCR_PASSWORD | ${ENGINE_CMD} login ghcr.io -u $GHCR_USERNAME --password-stdin
${ENGINE_CMD} push ghcr.io/${REPO}:${BASE_DISTRO}

if [ "${DEFAULT_DISTRO}" = "${BASE_DISTRO}" ]; then
${ENGINE_CMD} tag ${REPO}:${BASE_DISTRO} ghcr.io/${REPO}:latest
${ENGINE_CMD} push ghcr.io/${REPO}:latest
fi

else
echo "Not pushing since build was triggered by a pull request."
fi