Build Ks-Installer Release #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: 'Release Tags' | |
name: Build Ks-Installer Release | |
env: | |
# TODO: Change variable to your image's name. | |
IMAGE_NAME: ks-installer-ext | |
IMAGE_REPO: beclab | |
jobs: | |
release-linux-amd64: | |
runs-on: ubuntu-latest | |
if: github.repository == 'Above-Os/ks-installer-ext' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset (1) | |
id: upload-release-asset-1 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./deploy/cluster-configuration.yaml | |
asset_name: cluster-configuration.yaml | |
asset_content_type: application/yaml | |
- name: Upload Release Asset (2) | |
id: upload-release-asset-2 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./deploy/kubesphere-installer.yaml | |
asset_name: kubesphere-installer.yaml | |
asset_content_type: application/yaml | |
- name: Build Release Images List | |
run: > | |
docker run --rm | |
-v "$PWD":/usr/src/myapp -w /usr/src/myapp kubespheredev/release-tools:v0.0.1 | |
ansible-playbook release.yml --skip-tags=sync_images | |
- name: Upload Release Asset (3) | |
id: upload-release-asset-3 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./images-list.txt | |
asset_name: images-list.txt | |
asset_content_type: application/txt | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
with: | |
platforms: all | |
- name: Set up Docker buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Log into registry | |
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |
- name: Push image | |
run: | | |
IMAGE=$IMAGE_REPO/$IMAGE_NAME:${{ github.event.inputs.tags }} | |
docker buildx build --platform linux/amd64,linux/arm64 --push -f Dockerfile.complete -t $IMAGE . | |
echo "Push $IMAGE success!" |