Add WASM doom game example in Docker Compose file (#43) #2
This file contains 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
--- | |
# | |
# Copyright (C) 2023 Red Hat, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Build and publish the wasm examples | |
on: | |
push: | |
paths: | |
- "wasm/**" | |
- ".github/workflows/build-publish-wasm.yaml" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build all wasm examples | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install qemu dependency | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y qemu-user-static | |
- name: Update podman | |
run: | | |
sudo sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list" | |
curl -L https://build.opensuse.org/projects/devel:kubic:libcontainers:unstable/signing_keys/download?kind=gpg | sudo apt-key add - | |
sudo apt-get update -qq | |
sudo apt-get install -y podman | |
podman version | |
- name: Build Rust Hello World Wasm Image | |
id: build-image | |
run: | | |
SHORT_SHA1=$(echo ${GITHUB_SHA} | cut -c1-7) | |
podman build --platform wasi/wasm -t wasm-rust-hello-world -f ./wasm/rust-hello-world/Containerfile ./wasm/rust-hello-world | |
podman tag wasm-rust-hello-world wasm-rust-hello-world:${SHORT_SHA1} | |
echo "tags=latest ${SHORT_SHA1}" >> $GITHUB_OUTPUT | |
- name: Log in to Red Hat Registry | |
uses: redhat-actions/podman-login@v1 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: list images | |
run: | | |
podman images | |
echo "the tags are ${{ steps.build-image.outputs.tags }}" | |
- name: Push To quay.io | |
id: push-to-quay | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: wasm-rust-hello-world | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: quay.io/podman-desktop-demo |